From b028362df19e874c593841b9547cf116a8194fc8 Mon Sep 17 00:00:00 2001 From: kedhammar Date: Mon, 16 Dec 2024 16:16:59 +0100 Subject: [PATCH] init --- VERSIONLOG.md | 6 +++++- taca/nanopore/ONT_run_classes.py | 13 +++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/VERSIONLOG.md b/VERSIONLOG.md index bbfd07d1..9343f670 100644 --- a/VERSIONLOG.md +++ b/VERSIONLOG.md @@ -2,7 +2,11 @@ ## 20241216.1 -Email user instead of craching if unable to create Illumina runobject +Do not run ToulligQC if its output directory can be found. + +## 20241216.1 + +Email user instead of crashing if unable to create Illumina runobject ## 20241212.2 diff --git a/taca/nanopore/ONT_run_classes.py b/taca/nanopore/ONT_run_classes.py index 789bcfd3..808417c2 100644 --- a/taca/nanopore/ONT_run_classes.py +++ b/taca/nanopore/ONT_run_classes.py @@ -353,6 +353,15 @@ def copy_html_report(self): def toulligqc_report(self): """Generate a QC report for the run using ToulligQC and publish it to GenStat.""" + report_dir_name = "toulligqc_report" + + # Do not run this function if it's output dir exists in the run dir + if os.path.exists(f"{self.run_abspath}/{report_dir_name}"): + logging.info( + f"{self.run_name}: ToulligQC report dir already exists, skipping." + ) + return None + # Get sequencing summary file glob_summary = glob.glob(f"{self.run_abspath}/sequencing_summary*.txt") assert len(glob_summary) == 1, f"Found {len(glob_summary)} summary files" @@ -412,7 +421,7 @@ def toulligqc_report(self): "--sequencing-summary-source": summary, f"--{raw_data_format}-source": raw_data_path, "--output-directory": self.run_abspath, - "--report-name": "toulligqc_report", + "--report-name": report_dir_name, } if barcode_dirs: command_args["--barcoding"] = "" @@ -443,7 +452,7 @@ def toulligqc_report(self): f"{self.run_name}: Transferring ToulligQC report to ngi-internal..." ) # Transfer the ToulligQC .html report file to ngi-internal, renaming it to the full run ID. Requires password-free SSH access. - report_src_path = self.get_file("/toulligqc_report/report.html") + report_src_path = self.get_file(f"/{report_dir_name}/report.html") report_dest_path = os.path.join( self.toulligqc_reports_dir, f"report_{self.run_name}.html",