Skip to content
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
13 changes: 5 additions & 8 deletions seqBackupLib/illumina.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"A": "Illumina-NovaSeq",
"NB": "Illumina-MiniSeq",
"LH": "Illumina-NovaSeqX",
"SH": "Illumina-MiSeq",
}


Expand All @@ -35,9 +36,10 @@ def _parse_folder(self) -> dict[str, str]:
raise ValueError(f"Invalid date format in run name: {date}")

instrument = parts[1]
if extract_instrument_code(instrument) not in MACHINE_TYPES:
instrument_code = extract_instrument_code(instrument)
if instrument_code not in MACHINE_TYPES:
raise ValueError(f"Invalid instrument code in run name: {instrument}")
self.machine_type = MACHINE_TYPES[extract_instrument_code(instrument)]
self.machine_type = MACHINE_TYPES[instrument_code]

run_number = parts[2]
if not run_number.isdigit():
Expand All @@ -55,12 +57,7 @@ def _parse_folder(self) -> dict[str, str]:
"flowcell_id": flowcell_id,
}

if (
self.machine_type == "Illumina-HiSeq"
or self.machine_type == "Illumina-NovaSeq"
or self.machine_type == "Illumina-MiniSeq"
or self.machine_type == "Illumina-NovaSeqX"
):
if instrument_code in {"D", "A", "NB", "LH", "SH"}:
vals1["flowcell_id"] = vals1["flowcell_id"][1:]

return vals1
Expand Down
14 changes: 14 additions & 0 deletions test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,20 @@ def nextseq_dir(tmp_path) -> Path:
)


@pytest.fixture
def sh_dir(tmp_path) -> Path:
return setup_illumina_dir(
tmp_path / "20250610_SH00024_0006_ASC2107697-SC3",
"Undetermined_S0_L001_R1_001.fastq.gz",
[
"@SH00024:6:SC2107697-SC3:1:1101:18286:1000 1:N:0:ACGT+ACGT\n",
"ACGT\n",
"+\n",
"IIII\n",
],
)


@pytest.fixture
def full_miseq_dir(tmp_path) -> Path:
# Lane 1
Expand Down
1 change: 1 addition & 0 deletions test/test_illumina.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"M": "miseq_dir",
"NB": "miniseq_dir",
"VH": "nextseq_dir",
"SH": "sh_dir",
}


Expand Down