Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixing bugs on pipeline manager #292

Merged
merged 2 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion relecov_tools/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ def launch_pipeline(input, template, output, config):
"""
Create the symbolic links for the samples which are validated.
"""
new_launch = relecov_tools.launch_pipeline.LaunchPipeline(
new_launch = relecov_tools.pipeline_manager.LaunchPipeline(
input, template, output, config
)
new_launch.pipeline_exc()
Expand Down
24 changes: 10 additions & 14 deletions relecov_tools/pipeline_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,23 +55,18 @@ def __init__(
"configuration.json",
)
if not os.path.exists(pipeline_conf_file):
log.error(
"Pipeline config file %s does not exist ", self.pipeline_conf_file
)
log.error("Pipeline config file %s does not exist ", pipeline_conf_file)
stderr.print(
"[red] Pipeline config file "
+ self.pipeline_conf_file
+ " does not exist"
"[red] Pipeline config file " + pipeline_conf_file + " does not exist"
)
sys.exit(1)
conf_settings = relecov_tools.utils.read_json_file(pipeline_conf_file)
try:
data = conf_settings["pipelines"]["relecov"]
data = conf_settings["launch_pipeline"]
# get_topic_data("launch_pipeline", "analysis_name")
except KeyError:
log.error("Invalid pipeline config file %s ", self.pipeline_conf_file)
stderr.print(
"[red] Invalid pipeline config file " + self.pipeline_conf_file
)
log.error("Invalid pipeline config file %s ", pipeline_conf_file)
stderr.print("[red] Invalid pipeline config file " + pipeline_conf_file)
if (
"analysis_name" not in data
or "sample_stored_folder" not in data
Expand Down Expand Up @@ -163,7 +158,7 @@ def get_latest_lab_folder(self):
validate_files = [
os.path.join(data_folder["path"], f)
for f in os.listdir(data_folder["path"])
if f.startswith("validated_processed_metadata") and f.endswith(".json")
if f.startswith("validated_lab_metadata") and f.endswith(".json")
]
if not validate_files:
continue
Expand All @@ -175,11 +170,11 @@ def get_latest_lab_folder(self):
sample = {}
sample["sequencing_sample_id"] = item["sequencing_sample_id"]
sample["r1_fastq_file_path"] = os.path.join(
item["r1_fastq_file_path"], item["sequence_file_R1_fastq"]
item["r1_fastq_filepath"], item["sequence_file_R1_fastq"]
)
if "r2_fastq_file_path" in item:
sample["r2_fastq_file_path"] = os.path.join(
item["r2_fastq_file_path"], item["sequence_file_R2_fastq"]
item["r1_fastq_filepath"], item["sequence_file_R2_fastq"]
)
samples_data.append(sample)
lab_code = lab.split("/")[-1]
Expand Down Expand Up @@ -209,6 +204,7 @@ def pipeline_exc(self):
sequencing_r1_sample_id = item["sequencing_sample_id"] + "_R1." + ext
# copy r1 sequencing file into the output folder
raw_folder = os.path.join(self.analysis_folder, self.copied_sample_folder)

try:
shutil.copy(item["r1_fastq_file_path"], raw_folder)
# create simlink for the r1
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from setuptools import setup, find_packages

version = "0.0.5"
version = "0.0.6"

with open("README.md") as f:
readme = f.read()
Expand Down
Loading