From 547e9ebf87700671e1496d8834c5d16d7d6a23eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Sv=C3=A4rd?= <60181709+Karl-Svard@users.noreply.github.com> Date: Tue, 1 Oct 2024 13:35:04 +0200 Subject: [PATCH] Patch index parsing (#538)(patch) ### Fixed - Patch the way indexes are parsed in order to comply with the new naming format. --- cg_lims/get/fields.py | 11 ++++++----- .../artifacts/2-1454624.xml | 2 +- .../artifacts/2-1454625.xml | 2 +- .../artifacts/2-1454626.xml | 2 +- .../artifacts/2-1454627.xml | 2 +- .../artifacts/2-1454628.xml | 2 +- .../artifacts/2-1454629.xml | 2 +- .../artifacts/2-1454630.xml | 2 +- .../artifacts/2-1454631.xml | 2 +- .../artifacts/2-1454632.xml | 2 +- .../artifacts/2-1454633.xml | 2 +- .../artifacts/2-1454634.xml | 2 +- .../artifacts/2-1454635.xml | 2 +- .../artifacts/2-1454636.xml | 2 +- .../artifacts/2-1155129.xml | 2 +- .../artifacts/2-1155129_other_sample.xml | 2 +- .../artifacts/2-1155130.xml | 2 +- .../artifacts/2-1155130_other_sample.xml | 2 +- .../test_make_kapa_csv/artifacts/2-1155129.xml | 2 +- .../test_make_kapa_csv/artifacts/2-1155130.xml | 2 +- 20 files changed, 25 insertions(+), 24 deletions(-) diff --git a/cg_lims/get/fields.py b/cg_lims/get/fields.py index 21ec6480..990fa7e5 100644 --- a/cg_lims/get/fields.py +++ b/cg_lims/get/fields.py @@ -67,19 +67,20 @@ def get_artifact_well(artifact: Artifact) -> str: def get_index_well(artifact: Artifact): """Parsing out the index well position from the reagent label string which - typically looks like this: 'A05 IDT_10nt_446 (AGCGTGACCT-CCATCCGAGT)' + typically looks like this: '44_A05 IDT_10nt_446 (AGCGTGACCT-CCATCCGAGT)' """ if artifact.reagent_labels: # Assuming one reagent label per artifact (reagent_labels is a list): - reagent_label = artifact.reagent_labels[0] + reagent_label: str = artifact.reagent_labels[0] # Getting the index well: - index_well_with_zero = reagent_label.split(" ")[0] + index_well_with_zero_and_us: str = reagent_label.split(" ")[0] + index_well_with_zero: str = index_well_with_zero_and_us.split("_")[1] # Picking out column and removing zeros by int(): - index_well_col = int(index_well_with_zero[1:]) - index_well_row = index_well_with_zero[0] + index_well_col: int = int(index_well_with_zero[1:]) + index_well_row: str = index_well_with_zero[0] return f"{index_well_row}{index_well_col}" else: return "-" diff --git a/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454624.xml b/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454624.xml index b6a79fd6..d8dcf62a 100644 --- a/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454624.xml +++ b/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454624.xml @@ -11,6 +11,6 @@ true - + \ No newline at end of file diff --git a/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454625.xml b/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454625.xml index 061e4c24..06e5bfc4 100644 --- a/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454625.xml +++ b/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454625.xml @@ -11,6 +11,6 @@ true - + \ No newline at end of file diff --git a/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454626.xml b/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454626.xml index b1149353..408e258c 100644 --- a/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454626.xml +++ b/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454626.xml @@ -11,6 +11,6 @@ true - + \ No newline at end of file diff --git a/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454627.xml b/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454627.xml index e3a01eae..6e5192bb 100644 --- a/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454627.xml +++ b/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454627.xml @@ -11,6 +11,6 @@ true - + \ No newline at end of file diff --git a/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454628.xml b/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454628.xml index 485526bb..8787955f 100644 --- a/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454628.xml +++ b/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454628.xml @@ -11,6 +11,6 @@ true - + \ No newline at end of file diff --git a/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454629.xml b/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454629.xml index eae68c11..dbb3e4f0 100644 --- a/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454629.xml +++ b/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454629.xml @@ -11,6 +11,6 @@ true - + \ No newline at end of file diff --git a/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454630.xml b/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454630.xml index 8639b6ca..dafbf41e 100644 --- a/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454630.xml +++ b/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454630.xml @@ -11,6 +11,6 @@ true - + \ No newline at end of file diff --git a/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454631.xml b/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454631.xml index 849fd4ef..28afeac8 100644 --- a/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454631.xml +++ b/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454631.xml @@ -11,6 +11,6 @@ true - + \ No newline at end of file diff --git a/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454632.xml b/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454632.xml index cb5d16ea..8a14fa1d 100644 --- a/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454632.xml +++ b/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454632.xml @@ -11,6 +11,6 @@ true - + \ No newline at end of file diff --git a/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454633.xml b/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454633.xml index 433324d5..9beb59d9 100644 --- a/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454633.xml +++ b/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454633.xml @@ -11,6 +11,6 @@ true - + \ No newline at end of file diff --git a/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454634.xml b/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454634.xml index d0844b00..87d8fffb 100644 --- a/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454634.xml +++ b/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454634.xml @@ -11,6 +11,6 @@ true - + \ No newline at end of file diff --git a/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454635.xml b/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454635.xml index 963f75a8..f6de40e6 100644 --- a/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454635.xml +++ b/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454635.xml @@ -11,6 +11,6 @@ true - + \ No newline at end of file diff --git a/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454636.xml b/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454636.xml index 48f3df4c..2af92522 100644 --- a/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454636.xml +++ b/tests/fixtures/hamilton_sars_cov2_indexing_step/artifacts/2-1454636.xml @@ -11,6 +11,6 @@ true - + \ No newline at end of file diff --git a/tests/fixtures/make_kapa_csv_missing_udfs/artifacts/2-1155129.xml b/tests/fixtures/make_kapa_csv_missing_udfs/artifacts/2-1155129.xml index c705782c..126e58f8 100644 --- a/tests/fixtures/make_kapa_csv_missing_udfs/artifacts/2-1155129.xml +++ b/tests/fixtures/make_kapa_csv_missing_udfs/artifacts/2-1155129.xml @@ -10,7 +10,7 @@ true - + 375 15 103.464487677 diff --git a/tests/fixtures/make_kapa_csv_missing_udfs/artifacts/2-1155129_other_sample.xml b/tests/fixtures/make_kapa_csv_missing_udfs/artifacts/2-1155129_other_sample.xml index fca1cae5..bc0e5af3 100644 --- a/tests/fixtures/make_kapa_csv_missing_udfs/artifacts/2-1155129_other_sample.xml +++ b/tests/fixtures/make_kapa_csv_missing_udfs/artifacts/2-1155129_other_sample.xml @@ -10,7 +10,7 @@ true - + 375 15 103.464487677 diff --git a/tests/fixtures/make_kapa_csv_missing_udfs/artifacts/2-1155130.xml b/tests/fixtures/make_kapa_csv_missing_udfs/artifacts/2-1155130.xml index c9424720..91a46344 100644 --- a/tests/fixtures/make_kapa_csv_missing_udfs/artifacts/2-1155130.xml +++ b/tests/fixtures/make_kapa_csv_missing_udfs/artifacts/2-1155130.xml @@ -10,7 +10,7 @@ true - + 1500 5 408.310256999 diff --git a/tests/fixtures/make_kapa_csv_missing_udfs/artifacts/2-1155130_other_sample.xml b/tests/fixtures/make_kapa_csv_missing_udfs/artifacts/2-1155130_other_sample.xml index 64689211..f1b1be4e 100644 --- a/tests/fixtures/make_kapa_csv_missing_udfs/artifacts/2-1155130_other_sample.xml +++ b/tests/fixtures/make_kapa_csv_missing_udfs/artifacts/2-1155130_other_sample.xml @@ -10,7 +10,7 @@ true - + 1500 5 408.310256999 diff --git a/tests/fixtures/test_make_kapa_csv/artifacts/2-1155129.xml b/tests/fixtures/test_make_kapa_csv/artifacts/2-1155129.xml index c705782c..126e58f8 100644 --- a/tests/fixtures/test_make_kapa_csv/artifacts/2-1155129.xml +++ b/tests/fixtures/test_make_kapa_csv/artifacts/2-1155129.xml @@ -10,7 +10,7 @@ true - + 375 15 103.464487677 diff --git a/tests/fixtures/test_make_kapa_csv/artifacts/2-1155130.xml b/tests/fixtures/test_make_kapa_csv/artifacts/2-1155130.xml index c9424720..91a46344 100644 --- a/tests/fixtures/test_make_kapa_csv/artifacts/2-1155130.xml +++ b/tests/fixtures/test_make_kapa_csv/artifacts/2-1155130.xml @@ -10,7 +10,7 @@ true - + 1500 5 408.310256999