From d2a1c2beb4e38ea2b9cee315e65f436f3209ce5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Sv=C3=A4rd?= <60181709+Karl-Svard@users.noreply.github.com> Date: Tue, 14 Jan 2025 12:21:43 +0100 Subject: [PATCH] Patch for multiple apptags (#575)(patch) ### Fixed - Patch the use of multiple apptags to filter on for the top-up summary script --- .../aliquot_samples_for_enzymatic_fragmentation_twist.py | 4 +++- .../models/arnold/prep/twist/bead_purification_twist.py | 4 +++- cg_lims/scripts/one_time_scripts/topup_summary.py | 7 +++++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/cg_lims/models/arnold/prep/twist/aliquot_samples_for_enzymatic_fragmentation_twist.py b/cg_lims/models/arnold/prep/twist/aliquot_samples_for_enzymatic_fragmentation_twist.py index c6168eef..fe164eff 100644 --- a/cg_lims/models/arnold/prep/twist/aliquot_samples_for_enzymatic_fragmentation_twist.py +++ b/cg_lims/models/arnold/prep/twist/aliquot_samples_for_enzymatic_fragmentation_twist.py @@ -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): diff --git a/cg_lims/models/arnold/prep/twist/bead_purification_twist.py b/cg_lims/models/arnold/prep/twist/bead_purification_twist.py index a9526185..8a6eeaec 100644 --- a/cg_lims/models/arnold/prep/twist/bead_purification_twist.py +++ b/cg_lims/models/arnold/prep/twist/bead_purification_twist.py @@ -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" diff --git a/cg_lims/scripts/one_time_scripts/topup_summary.py b/cg_lims/scripts/one_time_scripts/topup_summary.py index 3b4b4084..afaafa7a 100644 --- a/cg_lims/scripts/one_time_scripts/topup_summary.py +++ b/cg_lims/scripts/one_time_scripts/topup_summary.py @@ -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")