Skip to content

Commit

Permalink
Patch for multiple apptags (#575)(patch)
Browse files Browse the repository at this point in the history
### Fixed
- Patch the use of multiple apptags to filter on for the top-up summary script
  • Loading branch information
Karl-Svard authored Jan 14, 2025
1 parent 4bf1687 commit d2a1c2b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ class ProcessUDFs(BaseModel):
lot_nr_h2o_aliquot_samples_fragmentation: Optional[str] = Field(
None, alias="Nuclease free water"
)
lot_nr_elution_buffer_aliquot_samples_fragmentation: Optional[str] = Field(None, alias="Lot no: Elution Buffer")
lot_nr_elution_buffer_aliquot_samples_fragmentation: Optional[str] = Field(
None, alias="Lot no: Elution Buffer"
)


class ArtifactUDFs(BaseModel):
Expand Down
4 changes: 3 additions & 1 deletion cg_lims/models/arnold/prep/twist/bead_purification_twist.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ class ArtifactUDFs(BaseModel):
class ProcessUDFs(BaseModel):
lot_nr_etoh_bead_purification_post_hyb: Optional[str] = Field(None, alias="Ethanol")
lot_nr_h2o_bead_purification_post_hyb: Optional[str] = Field(None, alias="Nuclease free water")
lot_nr_elution_buffer_bead_purification_post_hyb: Optional[str] = Field(None, alias="Lot no: Elution Buffer")
lot_nr_elution_buffer_bead_purification_post_hyb: Optional[str] = Field(
None, alias="Lot no: Elution Buffer"
)
bead_purification_post_hyb_method: Optional[str] = Field(None, alias="Method document")
binding_and_purification_beads: Optional[str] = Field(
None, alias="Twist Binding and Purification beads"
Expand Down
7 changes: 5 additions & 2 deletions cg_lims/scripts/one_time_scripts/topup_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,11 @@ def get_matching_samples(
lims: Lims, from_date: datetime.date, to_date: datetime.date, apptags: List[str]
) -> List[Sample]:
"""Return all samples matching the given apptags and timeframe."""
udf_dict: Dict[str, List[str]] = {"Sequencing Analysis": apptags}
found_samples: List[Sample] = lims.get_samples(udf=udf_dict)
found_samples: List[Sample] = []
for apptag in apptags:
udf_dict: Dict[str, List[str]] = {"Sequencing Analysis": [apptag]}
found_samples += lims.get_samples(udf=udf_dict)
LOG.info(f"Total amount samples with matching apptags: {len(found_samples)}.")
matching_samples: List[Sample] = []
for sample in found_samples:
sequenced_at: datetime.date = sample.udf.get("Sequencing Finished")
Expand Down

0 comments on commit d2a1c2b

Please sign in to comment.