Skip to content

Commit d632350

Browse files
authored
Merge pull request #16 from ssjunnebo/fcid_rename
Set FCID to whatever is scanned during sequencing setup
2 parents e359ad3 + 72c6c60 commit d632350

6 files changed

Lines changed: 29 additions & 13 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,6 @@ log:
8383

8484
run_one_path: /usr/bin/run-one
8585

86-
metadata_archive: /path/to/metadata/archive
87-
8886
transfer_details:
8987
user: username
9088
host: remote.host.com
@@ -99,6 +97,7 @@ sequencers:
9997
NovaSeqXPlus:
10098
sequencing_path: /sequencing/NovaSeqXPlus
10199
remote_destination: /Illumina/NovaSeqXPlus
100+
metadata_archive: /path/to/metadata/archive/NovaSeqXPlus_data
102101
metadata_for_statusdb:
103102
- RunInfo.xml
104103
- RunParameters.xml
@@ -150,6 +149,7 @@ Run status is tracked in CouchDB with events including:
150149
- Remote storage is accessible via rsync over SSH
151150
- CouchDB is accessible and the database exists
152151
- Metadata files (e.g., RunInfo.xml) are present in run directories for status database updates and sync to metadata archive location
152+
- The flowcell ID is set to correspond to the ID that is scanned with a barcode scanner during sequencing setup in the lab
153153

154154
### Status Files
155155

dataflow_transfer/run_classes/element_runs.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ class ElementRun(Run):
99
def __init__(self, run_dir, configuration):
1010
super().__init__(run_dir, configuration)
1111
self.final_file = "RunUploaded.json"
12-
self.flowcell_id = self.run_id.split("_")[
13-
-1
14-
] # This is true for all except Teton runs
1512

1613

1714
@register_run_class
@@ -22,6 +19,10 @@ class AVITIRun(ElementRun):
2219

2320
def __init__(self, run_dir, configuration):
2421
self.run_id_format = (
25-
r"^\d{8}_AV\d{6}_(A|BP)\d{10}$" # 20251007_AV242106_A2507535225
22+
r"^\d{8}_AV\d{6}_(A|B)\d{10}$" # 20251007_AV242106_A2507535225
2623
)
2724
super().__init__(run_dir, configuration)
25+
self.flowcell_id = self.run_id.split("_")[-1][1:] # 2507535225
26+
27+
28+
# TODO: Add Teton run class

dataflow_transfer/run_classes/generic_runs.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ def __init__(self, run_dir, configuration):
2525
self.run_dir, ".metadata_rsync_exitcode"
2626
)
2727
self.metadata_destination = os.path.join(
28-
self.configuration.get("metadata_archive"),
29-
getattr(self, "run_type", None),
28+
self.sequencer_config.get("metadata_archive"),
3029
self.run_id,
3130
)
3231
self.final_rsync_exitcode_file = os.path.join(

dataflow_transfer/run_classes/illumina_runs.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ def __init__(self, run_dir, configuration):
2323
r"^\d{8}_[A-Z0-9]+_\d{4}_[A-Z0-9]+$" # 20251010_LH00202_0284_B22CVHTLT1
2424
)
2525
super().__init__(run_dir, configuration)
26+
self.flowcell_id = self.run_id.split("_")[-1][1:] # 22CVHTLT1
2627

2728

2829
@register_run_class
@@ -60,3 +61,4 @@ class MiSeqi100Run(IlluminaRun):
6061
def __init__(self, run_dir, configuration):
6162
self.run_id_format = r"^\d{8}_[A-Z0-9]+_\d{4}_[A-Z0-9]{10}-SC3$" # 20260128_SH01140_0002_ASC2150561-SC3
6263
super().__init__(run_dir, configuration)
64+
self.flowcell_id = self.run_id.split("_")[-1][1:] # SC2150561-SC3

dataflow_transfer/tests/test_run_classes.py

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ def novaseqxplus_testobj(tmp_path):
1212
config = {
1313
"log": {"file": "test.log"},
1414
"transfer_details": {"user": "testuser", "host": "testhost"},
15-
"metadata_archive": "/data/metadata_archive",
1615
"statusdb": {
1716
"username": "dbuser",
1817
"password": "dbpass",
@@ -23,6 +22,7 @@ def novaseqxplus_testobj(tmp_path):
2322
"NovaSeqXPlus": {
2423
"remote_destination": "/data/NovaSeqXPlus",
2524
"metadata_for_statusdb": ["RunInfo.xml", "RunParameters.xml"],
25+
"metadata_archive": "/data/metadata_archive/NovaSeqXPlus",
2626
"ignore_folders": ["nosync"],
2727
"remote_rsync_options": ["--chmod=Dg+s,g+rw"],
2828
"metadata_rsync_options": [
@@ -44,7 +44,6 @@ def nextseq_testobj(tmp_path):
4444
config = {
4545
"log": {"file": "test.log"},
4646
"transfer_details": {"user": "testuser", "host": "testhost"},
47-
"metadata_archive": "/data/metadata_archive",
4847
"statusdb": {
4948
"username": "dbuser",
5049
"password": "dbpass",
@@ -55,6 +54,7 @@ def nextseq_testobj(tmp_path):
5554
"NextSeq": {
5655
"remote_destination": "/data/NextSeq",
5756
"metadata_for_statusdb": ["RunInfo.xml", "RunParameters.xml"],
57+
"metadata_archive": "/data/metadata_archive/NextSeq",
5858
"ignore_folders": ["nosync"],
5959
"remote_rsync_options": ["--chmod=Dg+s,g+rw"],
6060
"metadata_rsync_options": [
@@ -76,7 +76,6 @@ def miseqseq_testobj(tmp_path):
7676
config = {
7777
"log": {"file": "test.log"},
7878
"transfer_details": {"user": "testuser", "host": "testhost"},
79-
"metadata_archive": "/data/metadata_archive",
8079
"statusdb": {
8180
"username": "dbuser",
8281
"password": "dbpass",
@@ -87,6 +86,7 @@ def miseqseq_testobj(tmp_path):
8786
"MiSeq": {
8887
"remote_destination": "/data/MiSeq",
8988
"metadata_for_statusdb": ["RunInfo.xml", "RunParameters.xml"],
89+
"metadata_archive": "/data/metadata_archive/MiSeq",
9090
"ignore_folders": ["nosync"],
9191
"remote_rsync_options": ["--chmod=Dg+s,g+rw"],
9292
"metadata_rsync_options": [
@@ -108,7 +108,6 @@ def miseqseqi100_testobj(tmp_path):
108108
config = {
109109
"log": {"file": "test.log"},
110110
"transfer_details": {"user": "testuser", "host": "testhost"},
111-
"metadata_archive": "/data/metadata_archive",
112111
"statusdb": {
113112
"username": "dbuser",
114113
"password": "dbpass",
@@ -119,6 +118,7 @@ def miseqseqi100_testobj(tmp_path):
119118
"MiSeqi100": {
120119
"remote_destination": "/data/MiSeqi100",
121120
"metadata_for_statusdb": ["RunInfo.xml", "RunParameters.xml"],
121+
"metadata_archive": "/data/metadata_archive/MiSeqi100",
122122
"ignore_folders": ["nosync"],
123123
"remote_rsync_options": ["--chmod=Dg+s,g+rw"],
124124
"metadata_rsync_options": [
@@ -169,6 +169,20 @@ def test_confirm_run_type(run_fixture, expected_run_type, request):
169169
run_obj.confirm_run_type()
170170

171171

172+
@pytest.mark.parametrize(
173+
"run_fixture, expected_flowcell",
174+
[
175+
("novaseqxplus_testobj", "22CVHTLT1"),
176+
("nextseq_testobj", "AAHFHCCM5"),
177+
("miseqseq_testobj", "000000000-M6D7K"),
178+
("miseqseqi100_testobj", "SC2150561-SC3"),
179+
],
180+
)
181+
def test_flowcell_id_is_computed(run_fixture, expected_flowcell, request):
182+
run_obj = request.getfixturevalue(run_fixture)
183+
assert run_obj.flowcell_id == expected_flowcell
184+
185+
172186
@pytest.mark.parametrize(
173187
"run_fixture",
174188
[

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.1.1"
23+
version = "1.1.2"
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)