Skip to content

Commit 41780b0

Browse files
authored
Merge pull request #12 from ssjunnebo/miseqi100
Miseqi100 integration
2 parents b2e8e1d + 13e553a commit 41780b0

6 files changed

Lines changed: 75 additions & 7 deletions

File tree

dataflow_transfer/run_classes/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
MiSeqRun, # noqa: F401
66
NextSeqRun, # noqa: F401
77
NovaSeqXPlusRun, # noqa: F401
8+
MiSeqi100Run, # noqa: F401
89
)
910
from dataflow_transfer.run_classes.ont_runs import MinIONRun, PromethIONRun # noqa: F401
1011

dataflow_transfer/run_classes/element_runs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ class AVITIRun(ElementRun):
2222

2323
def __init__(self, run_dir, configuration):
2424
self.run_id_format = (
25-
"^\d{8}_AV\d{6}_(A|BP)\d{10}$" # 20251007_AV242106_A2507535225
25+
r"^\d{8}_AV\d{6}_(A|BP)\d{10}$" # 20251007_AV242106_A2507535225
2626
)
2727
super().__init__(run_dir, configuration)

dataflow_transfer/run_classes/illumina_runs.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class NovaSeqXPlusRun(IlluminaRun):
2020

2121
def __init__(self, run_dir, configuration):
2222
self.run_id_format = (
23-
"^\d{8}_[A-Z0-9]+_\d{4}_[A-Z0-9]+$" # 20251010_LH00202_0284_B22CVHTLT1
23+
r"^\d{8}_[A-Z0-9]+_\d{4}_[A-Z0-9]+$" # 20251010_LH00202_0284_B22CVHTLT1
2424
)
2525
super().__init__(run_dir, configuration)
2626

@@ -33,7 +33,7 @@ class NextSeqRun(IlluminaRun):
3333

3434
def __init__(self, run_dir, configuration):
3535
self.run_id_format = (
36-
"^\d{6}_[A-Z0-9]+_\d{3}_[A-Z0-9]+$" # 251015_VH00203_572_AAHFHCCM5
36+
r"^\d{6}_[A-Z0-9]+_\d{3}_[A-Z0-9]+$" # 251015_VH00203_572_AAHFHCCM5
3737
)
3838
super().__init__(run_dir, configuration)
3939

@@ -46,6 +46,17 @@ class MiSeqRun(IlluminaRun):
4646

4747
def __init__(self, run_dir, configuration):
4848
self.run_id_format = (
49-
"^\d{6}_[A-Z0-9]+_\d{4}_[A-Z0-9\-]+$" # 251015_M01548_0646_000000000-M6D7K
49+
r"^\d{6}_[A-Z0-9]+_\d{4}_[A-Z0-9\-]+$" # 251015_M01548_0646_000000000-M6D7K
5050
)
5151
super().__init__(run_dir, configuration)
52+
53+
54+
@register_run_class
55+
class MiSeqi100Run(IlluminaRun):
56+
"""Defines a MiSeqi100 sequencing run"""
57+
58+
run_type = "MiSeqi100"
59+
60+
def __init__(self, run_dir, configuration):
61+
self.run_id_format = r"^\d{8}_[A-Z0-9]+_\d{4}_[A-Z0-9]{10}-SC3$" # 20260128_SH01140_0002_ASC2150561-SC3
62+
super().__init__(run_dir, configuration)

dataflow_transfer/run_classes/ont_runs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class PromethIONRun(ONTRun):
1919
run_type = "PromethION"
2020

2121
def __init__(self, run_dir, configuration):
22-
self.run_id_format = "^\d{8}_\d{4}_[A-Z0-9]{2}_P[A-Z0-9]+_[a-f0-9]{8}$" # 20251015_1051_3B_PBG60686_0af3a2e0
22+
self.run_id_format = r"^\d{8}_\d{4}_[A-Z0-9]{2}_P[A-Z0-9]+_[a-f0-9]{8}$" # 20251015_1051_3B_PBG60686_0af3a2e0
2323
super().__init__(run_dir, configuration)
2424

2525

@@ -30,5 +30,5 @@ class MinIONRun(ONTRun):
3030
run_type = "MinION"
3131

3232
def __init__(self, run_dir, configuration):
33-
self.run_id_format = "^\d{8}_\d{4}_MN[A-Z0-9]+_[A-Z0-9]+_[a-f0-9]{8}$" # 20240229_1404_MN19414_ASH657_7a74bf8f
33+
self.run_id_format = r"^\d{8}_\d{4}_MN[A-Z0-9]+_[A-Z0-9]+_[a-f0-9]{8}$" # 20240229_1404_MN19414_ASH657_7a74bf8f
3434
super().__init__(run_dir, configuration)

dataflow_transfer/tests/test_run_classes.py

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,32 @@ def miseqseq_testobj(tmp_path):
8585
return illumina_runs.MiSeqRun(str(run_dir), config)
8686

8787

88+
@pytest.fixture
89+
def miseqseqi100_testobj(tmp_path):
90+
config = {
91+
"log": {"file": "test.log"},
92+
"transfer_details": {"user": "testuser", "host": "testhost"},
93+
"statusdb": {
94+
"username": "dbuser",
95+
"password": "dbpass",
96+
"url:": "dburl",
97+
"database": "dbname",
98+
},
99+
"sequencers": {
100+
"MiSeqi100": {
101+
"miarka_destination": "/data/MiSeqi100",
102+
"metadata_for_statusdb": ["RunInfo.xml", "RunParameters.xml"],
103+
"ignore_folders": ["nosync"],
104+
"rsync_options": ["--chmod=Dg+s,g+rw"],
105+
}
106+
},
107+
}
108+
run_id = "20260128_SH01140_0002_ASC2150561-SC3"
109+
run_dir = tmp_path / run_id
110+
run_dir.mkdir()
111+
return illumina_runs.MiSeqi100Run(str(run_dir), config)
112+
113+
88114
@pytest.fixture(autouse=True)
89115
def mock_statusdbsession(monkeypatch):
90116
class MockStatusdbSession:
@@ -106,6 +132,7 @@ def update_db_doc(self, doc):
106132
("novaseqxplus_testobj", "NovaSeqXPlus"),
107133
("nextseq_testobj", "NextSeq"),
108134
("miseqseq_testobj", "MiSeq"),
135+
("miseqseqi100_testobj", "MiSeqi100"),
109136
],
110137
)
111138
def test_confirm_run_type(run_fixture, expected_run_type, request):
@@ -124,6 +151,7 @@ def test_confirm_run_type(run_fixture, expected_run_type, request):
124151
"novaseqxplus_testobj",
125152
"nextseq_testobj",
126153
"miseqseq_testobj",
154+
"miseqseqi100_testobj",
127155
],
128156
)
129157
def test_sequencing_ongoing(run_fixture, request):
@@ -146,6 +174,8 @@ def test_sequencing_ongoing(run_fixture, request):
146174
("nextseq_testobj", True),
147175
("miseqseq_testobj", False),
148176
("miseqseq_testobj", True),
177+
("miseqseqi100_testobj", False),
178+
("miseqseqi100_testobj", True),
149179
],
150180
)
151181
def test_generate_rsync_command(run_fixture, final_sync, request):
@@ -174,6 +204,10 @@ def test_generate_rsync_command(run_fixture, final_sync, request):
174204
("miseqseq_testobj", True, False),
175205
("miseqseq_testobj", False, True),
176206
("miseqseq_testobj", True, True),
207+
("miseqseqi100_testobj", False, False),
208+
("miseqseqi100_testobj", True, False),
209+
("miseqseqi100_testobj", False, True),
210+
("miseqseqi100_testobj", True, True),
177211
],
178212
)
179213
def test_start_transfer(run_fixture, rsync_running, final, request, monkeypatch):
@@ -219,6 +253,8 @@ def mock_update_statusdb(status, additional_info=None):
219253
("nextseq_testobj", False),
220254
("miseqseq_testobj", True),
221255
("miseqseq_testobj", False),
256+
("miseqseqi100_testobj", True),
257+
("miseqseqi100_testobj", False),
222258
],
223259
)
224260
def test_final_sync_successful(run_fixture, sync_successful, request):
@@ -249,6 +285,10 @@ def test_final_sync_successful(run_fixture, sync_successful, request):
249285
("miseqseq_testobj", "sequencing_started", True),
250286
("miseqseq_testobj", "sequencing_finished", False),
251287
("miseqseq_testobj", "sequencing_finished", True),
288+
("miseqseqi100_testobj", "sequencing_started", False),
289+
("miseqseqi100_testobj", "sequencing_started", True),
290+
("miseqseqi100_testobj", "sequencing_finished", False),
291+
("miseqseqi100_testobj", "sequencing_finished", True),
252292
],
253293
)
254294
def test_has_status(run_fixture, status_to_check, expected_result, request):
@@ -268,6 +308,12 @@ def get_events(self, run_id):
268308
@pytest.mark.parametrize(
269309
"run_fixture, existing_statuses, status_to_update",
270310
[
311+
("novaseqxplus_testobj", [], "sequencing_started"),
312+
(
313+
"novaseqxplus_testobj",
314+
[{"event_type": "sequencing_started"}],
315+
"transfer_started",
316+
),
271317
(
272318
"nextseq_testobj",
273319
[],
@@ -288,6 +334,16 @@ def get_events(self, run_id):
288334
[{"event_type": "sequencing_started"}],
289335
"transfer_started",
290336
),
337+
(
338+
"miseqseqi100_testobj",
339+
[],
340+
"sequencing_started",
341+
),
342+
(
343+
"miseqseqi100_testobj",
344+
[{"event_type": "sequencing_started"}],
345+
"transfer_started",
346+
),
291347
],
292348
)
293349
def test_update_statusdb(

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ ignore = [
2020

2121
[project]
2222
name = "dataflow_transfer"
23-
version = "1.0.4"
23+
version = "1.0.5"
2424
description = "Script for transferring sequencing data from sequencers to storage"
2525
authors = [
2626
{ name = "Sara Sjunnebo", email = "sara.sjunnebo@scilifelab.se" },

0 commit comments

Comments
 (0)