From 0f7ab54cdf0108d2e51b427d002f78cb1c9cc464 Mon Sep 17 00:00:00 2001 From: kedhammar Date: Tue, 7 May 2024 15:44:21 +0200 Subject: [PATCH 1/2] init --- VERSIONLOG.md | 4 ++++ taca/nanopore/instrument_transfer.py | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/VERSIONLOG.md b/VERSIONLOG.md index 378cf90d..4658510c 100644 --- a/VERSIONLOG.md +++ b/VERSIONLOG.md @@ -1,5 +1,9 @@ # TACA Version Log +## 20240507.1 + +Broaden ONT transfer script's categorization of QC runs to either experiment dir or sample dir starting with "QC\_". + ## 20240422.1 Refine GHA VERSIONLOG.md check to compare to merge-base, not branch-base. diff --git a/taca/nanopore/instrument_transfer.py b/taca/nanopore/instrument_transfer.py index bf9bf8bd..fe83c09f 100644 --- a/taca/nanopore/instrument_transfer.py +++ b/taca/nanopore/instrument_transfer.py @@ -50,8 +50,9 @@ def main(args): for run_path in run_paths: logging.info(f"Handling {run_path}...") - if run_path.split(os.sep)[-2][0:3] == "QC_": - # For QC runs, the sample name should start with "QC_" + experiment_name = run_path.split(os.sep)[-3] + sample_name = run_path.split(os.sep)[-2] + if sample_name[0:3] == "QC_" or experiment_name[0:3] == "QC_": logging.info("Run categorized as QC.") rsync_dest = args.dest_dir_qc else: From b40dc62c77873b4d69490c76025abc02d12bbe0b Mon Sep 17 00:00:00 2001 From: kedhammar Date: Tue, 7 May 2024 15:50:11 +0200 Subject: [PATCH 2/2] ruff fix --- taca/utils/misc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/taca/utils/misc.py b/taca/utils/misc.py index a180bcfd..67f7c47d 100755 --- a/taca/utils/misc.py +++ b/taca/utils/misc.py @@ -162,7 +162,7 @@ def query_yes_no(question, default="yes", force=False): elif default == "no": prompt = " [y/N] " else: - raise ValueError('invalid default answer: "%s"' % default) + raise ValueError(f'invalid default answer: "{default}"') while True: sys.stdout.write(question + prompt)