Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch index parsing #538

Merged
merged 3 commits into from
Oct 1, 2024
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
11 changes: 6 additions & 5 deletions cg_lims/get/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 "-"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
</location>
<working-flag>true</working-flag>
<sample uri="http://127.0.0.1:8000/api/v2/samples/ACC7892A1" limsid="ACC7892A1" />
<reagent-label name="A01 UDP0001 (GAACTGAGCG-TCGTGGAGCG)" />
<reagent-label name="01_A01 UDP0001 (GAACTGAGCG-TCGTGGAGCG)" />
<workflow-stages />
</art:artifact>
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
</location>
<working-flag>true</working-flag>
<sample uri="http://127.0.0.1:8000/api/v2/samples/ACC7892A5" limsid="ACC7892A5" />
<reagent-label name="A02 UDP0009 (GACTGAGTAG-GTTGATAGTG)" />
<reagent-label name="09_A02 UDP0009 (GACTGAGTAG-GTTGATAGTG)" />
<workflow-stages />
</art:artifact>
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
</location>
<working-flag>true</working-flag>
<sample uri="http://127.0.0.1:8000/api/v2/samples/ACC7892A9" limsid="ACC7892A9" />
<reagent-label name="A03 UDP0017 (GAGAATGGTT-TCGGCAGCAA)" />
<reagent-label name="17_A03 UDP0017 (GAGAATGGTT-TCGGCAGCAA)" />
<workflow-stages />
</art:artifact>
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
</location>
<working-flag>true</working-flag>
<sample uri="http://127.0.0.1:8000/api/v2/samples/ACC7892A13" limsid="ACC7892A13" />
<reagent-label name="A04 UDP0025 (AACCATAGAA-GGCGAGATGG)" />
<reagent-label name="25_A04 UDP0025 (AACCATAGAA-GGCGAGATGG)" />
<workflow-stages />
</art:artifact>
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
</location>
<working-flag>true</working-flag>
<sample uri="http://127.0.0.1:8000/api/v2/samples/ACC7892A16" limsid="ACC7892A16" />
<reagent-label name="A05 UDP0033 (TGATTATACG-GTCGATTACA)" />
<reagent-label name="33_A05 UDP0033 (TGATTATACG-GTCGATTACA)" />
<workflow-stages />
</art:artifact>
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
</location>
<working-flag>true</working-flag>
<sample uri="http://127.0.0.1:8000/api/v2/samples/ACC7892A57" limsid="ACC7892A57" />
<reagent-label name="A06 UDP0041 (ACTCGGCAAT-GACAACTGAA)" />
<reagent-label name="41_A06 UDP0041 (ACTCGGCAAT-GACAACTGAA)" />
<workflow-stages />
</art:artifact>
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
</location>
<working-flag>true</working-flag>
<sample uri="http://127.0.0.1:8000/api/v2/samples/ACC7892A64" limsid="ACC7892A64" />
<reagent-label name="A07 UDP0049 (AGTGTTGCAC-CTGGTACACG)" />
<reagent-label name="49_A07 UDP0049 (AGTGTTGCAC-CTGGTACACG)" />
<workflow-stages />
</art:artifact>
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
</location>
<working-flag>true</working-flag>
<sample uri="http://127.0.0.1:8000/api/v2/samples/ACC7892A65" limsid="ACC7892A65" />
<reagent-label name="A08 UDP0057 (TCTATCCTAA-CGTCGACTGG)" />
<reagent-label name="57_A08 UDP0057 (TCTATCCTAA-CGTCGACTGG)" />
<workflow-stages />
</art:artifact>
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
</location>
<working-flag>true</working-flag>
<sample uri="http://127.0.0.1:8000/api/v2/samples/ACC7892A70" limsid="ACC7892A70" />
<reagent-label name="A09 UDP0065 (TAATGTGTCT-GTAAGGCATA)" />
<reagent-label name="65_A09 UDP0065 (TAATGTGTCT-GTAAGGCATA)" />
<workflow-stages />
</art:artifact>
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
</location>
<working-flag>true</working-flag>
<sample uri="http://127.0.0.1:8000/api/v2/samples/ACC7892A73" limsid="ACC7892A73" />
<reagent-label name="A10 UDP0073 (CCTGCGGAAC-ATCATAGGCT)" />
<reagent-label name="73_A10 UDP0073 (CCTGCGGAAC-ATCATAGGCT)" />
<workflow-stages />
</art:artifact>
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
</location>
<working-flag>true</working-flag>
<sample uri="http://127.0.0.1:8000/api/v2/samples/ACC7892A78" limsid="ACC7892A78" />
<reagent-label name="A11 UDP0081 (TGTCGCTGGT-TCGTCTGACT)" />
<reagent-label name="81_A11 UDP0081 (TGTCGCTGGT-TCGTCTGACT)" />
<workflow-stages />
</art:artifact>
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
</location>
<working-flag>true</working-flag>
<sample uri="http://127.0.0.1:8000/api/v2/samples/ACC7892A81" limsid="ACC7892A81" />
<reagent-label name="A12 UDP0089 (GTCCGTAAGC-CGTGTATCTT)" />
<reagent-label name="89_A12 UDP0089 (GTCCGTAAGC-CGTGTATCTT)" />
<workflow-stages />
</art:artifact>
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
</location>
<working-flag>true</working-flag>
<sample uri="http://127.0.0.1:8000/api/v2/samples/ACC7892A92" limsid="ACC7892A92" />
<reagent-label name="B01 UDP0002 (AGGTCAGATA-CTACAAGATA)" />
<reagent-label name="02_B01 UDP0002 (AGGTCAGATA-CTACAAGATA)" />
<workflow-stages />
</art:artifact>
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</location>
<working-flag>true</working-flag>
<sample uri="http://127.0.0.1:8000/api/v2/samples/ACC7271A5" limsid="ACC7271A5"/>
<reagent-label name="A02 IDT_10nt_652 (ACAACCAACT-ACCATCTTGT)"/>
<reagent-label name="09_A02 IDT_10nt_652 (ACAACCAACT-ACCATCTTGT)"/>
<udf:field type="Numeric" name="Amount (ng)">375</udf:field>
<udf:field type="Numeric" name="Volume of sample (ul)">15</udf:field>
<udf:field type="Numeric" name="Concentration (nM)">103.464487677</udf:field>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</location>
<working-flag>true</working-flag>
<sample uri="http://127.0.0.1:8000/api/v2/samples/dummy_sample1" limsid="dummy_sample1"/>
<reagent-label name="A02 IDT_10nt_652 (ACAACCAACT-ACCATCTTGT)"/>
<reagent-label name="09_A02 IDT_10nt_652 (ACAACCAACT-ACCATCTTGT)"/>
<udf:field type="Numeric" name="Amount (ng)">375</udf:field>
<udf:field type="Numeric" name="Volume of sample (ul)">15</udf:field>
<udf:field type="Numeric" name="Concentration (nM)">103.464487677</udf:field>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</location>
<working-flag>true</working-flag>
<sample uri="http://127.0.0.1:8000/api/v2/samples/ACC7272A2" limsid="ACC7272A2"/>
<reagent-label name="A01 IDT_10nt_651 (ATGGTTGACT-GCTTGTGCCA)"/>
<reagent-label name="01_A01 IDT_10nt_651 (ATGGTTGACT-GCTTGTGCCA)"/>
<udf:field type="Numeric" name="Amount (ng)">1500</udf:field>
<udf:field type="Numeric" name="Volume of sample (ul)">5</udf:field>
<udf:field type="Numeric" name="Concentration (nM)">408.310256999</udf:field>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</location>
<working-flag>true</working-flag>
<sample uri="http://127.0.0.1:8000/api/v2/samples/dummy_sample2" limsid="dummy_sample2"/>
<reagent-label name="A01 IDT_10nt_651 (ATGGTTGACT-GCTTGTGCCA)"/>
<reagent-label name="01_A01 IDT_10nt_651 (ATGGTTGACT-GCTTGTGCCA)"/>
<udf:field type="Numeric" name="Amount (ng)">1500</udf:field>
<udf:field type="Numeric" name="Volume of sample (ul)">5</udf:field>
<udf:field type="Numeric" name="Concentration (nM)">408.310256999</udf:field>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</location>
<working-flag>true</working-flag>
<sample uri="http://127.0.0.1:8000/api/v2/samples/ACC7271A5" limsid="ACC7271A5"/>
<reagent-label name="A02 IDT_10nt_652 (ACAACCAACT-ACCATCTTGT)"/>
<reagent-label name="09_A02 IDT_10nt_652 (ACAACCAACT-ACCATCTTGT)"/>
<udf:field type="Numeric" name="Amount (ng)">375</udf:field>
<udf:field type="Numeric" name="Volume of sample (ul)">15</udf:field>
<udf:field type="Numeric" name="Concentration (nM)">103.464487677</udf:field>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</location>
<working-flag>true</working-flag>
<sample uri="http://127.0.0.1:8000/api/v2/samples/ACC7272A2" limsid="ACC7272A2"/>
<reagent-label name="A01 IDT_10nt_651 (ATGGTTGACT-GCTTGTGCCA)"/>
<reagent-label name="01_A01 IDT_10nt_651 (ATGGTTGACT-GCTTGTGCCA)"/>
<udf:field type="Numeric" name="Amount (ng)">1500</udf:field>
<udf:field type="Numeric" name="Volume of sample (ul)">5</udf:field>
<udf:field type="Numeric" name="Concentration (nM)">408.310256999</udf:field>
Expand Down
Loading