From 8797f3c686f5dd6db78d12ca9b350947cd2eeccc Mon Sep 17 00:00:00 2001 From: chuan-wang Date: Tue, 10 Sep 2024 14:18:00 +0200 Subject: [PATCH 1/2] Support both single lane and dual lane of AVITI flowcell --- VERSIONLOG.md | 4 ++++ scripts/generate_aviti_run_manifest.py | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/VERSIONLOG.md b/VERSIONLOG.md index 01a712a6..78878133 100644 --- a/VERSIONLOG.md +++ b/VERSIONLOG.md @@ -1,5 +1,9 @@ # Scilifelab_epps Version Log +## 20240910.2 + +Support both single lane and dual lane of AVITI flowcell + ## 20240910.1 Downprioritize column 3 of PromethION (used by CG), when running script to suggest ports. diff --git a/scripts/generate_aviti_run_manifest.py b/scripts/generate_aviti_run_manifest.py index 3302bcc1..513d28e6 100644 --- a/scripts/generate_aviti_run_manifest.py +++ b/scripts/generate_aviti_run_manifest.py @@ -79,11 +79,11 @@ def get_samples_section(process: Process) -> str: phix_loaded: bool = process.udf["PhiX Loaded"] - # Assert two output analytes placed in either flowcell lane + # Assert output analytes loaded on flowcell arts_out = [op for op in process.all_outputs() if op.type == "Analyte"] - assert len(arts_out) == 2, "Expected two output analytes." - lanes = [art_out.location[1].split(":")[1] for art_out in arts_out] - assert set(lanes) == {"1", "2"}, "Expected lanes 1 and 2." + assert len(arts_out) == 1 or len(arts_out) == 2, "Expected one or two output analytes." + lanes = [art_out.location[1].split(":")[0] for art_out in arts_out] + assert set(lanes) == {"1"} or set(lanes) == {"1", "2"}, "Expected a single-lane or dual-lane flowcell." # Iterate over pools all_rows = [] From 9d0f2a5c9d8a43d8887fe43ee19b7efc68331628 Mon Sep 17 00:00:00 2001 From: chuan-wang Date: Tue, 10 Sep 2024 14:28:07 +0200 Subject: [PATCH 2/2] Decide whether to include PhiX based on lane level UDF --- VERSIONLOG.md | 1 + scripts/generate_aviti_run_manifest.py | 15 ++++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/VERSIONLOG.md b/VERSIONLOG.md index 78878133..507fcd47 100644 --- a/VERSIONLOG.md +++ b/VERSIONLOG.md @@ -3,6 +3,7 @@ ## 20240910.2 Support both single lane and dual lane of AVITI flowcell +Decide whether to include PhiX based on lane level UDF ## 20240910.1 diff --git a/scripts/generate_aviti_run_manifest.py b/scripts/generate_aviti_run_manifest.py index 513d28e6..2d26117b 100644 --- a/scripts/generate_aviti_run_manifest.py +++ b/scripts/generate_aviti_run_manifest.py @@ -77,13 +77,16 @@ def get_settings_section() -> str: def get_samples_section(process: Process) -> str: """Generate the [SAMPLES] section of the AVITI run manifest and return it as a string.""" - phix_loaded: bool = process.udf["PhiX Loaded"] - # Assert output analytes loaded on flowcell arts_out = [op for op in process.all_outputs() if op.type == "Analyte"] - assert len(arts_out) == 1 or len(arts_out) == 2, "Expected one or two output analytes." + assert ( + len(arts_out) == 1 or len(arts_out) == 2 + ), "Expected one or two output analytes." lanes = [art_out.location[1].split(":")[0] for art_out in arts_out] - assert set(lanes) == {"1"} or set(lanes) == {"1", "2"}, "Expected a single-lane or dual-lane flowcell." + assert set(lanes) == {"1"} or set(lanes) == { + "1", + "2", + }, "Expected a single-lane or dual-lane flowcell." # Iterate over pools all_rows = [] @@ -140,7 +143,9 @@ def get_samples_section(process: Process) -> str: lane_rows.append(row) - # Add PhiX controls + # Add PhiX controls if added: + phix_loaded: bool = art_out.udf["% phiX"] != 0 + if phix_loaded: for phix_idx_pair in [ ("ACGTGTAGC", "GCTAGTGCA"),