From aef457e0c0dec3ceaf5997dcd2bf2facd6519f98 Mon Sep 17 00:00:00 2001 From: Annick Renevey <47788523+rannick@users.noreply.github.com> Date: Tue, 3 Sep 2024 18:28:10 +0200 Subject: [PATCH] add sample id to hk tage --- cg/meta/upload/scout/raredisease_config_builder.py | 11 ++++++----- cg/models/scout/scout_load_config.py | 1 - 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cg/meta/upload/scout/raredisease_config_builder.py b/cg/meta/upload/scout/raredisease_config_builder.py index 6001921ae8..8f6cf767e6 100644 --- a/cg/meta/upload/scout/raredisease_config_builder.py +++ b/cg/meta/upload/scout/raredisease_config_builder.py @@ -94,7 +94,7 @@ def build_config_sample(self, case_sample: CaseSample) -> ScoutRarediseaseIndivi config_sample = ScoutRarediseaseIndividual() self.add_common_sample_info(config_sample=config_sample, case_sample=case_sample) # self.add_common_sample_files(config_sample=config_sample, case_sample=case_sample) - self.include_sample_files(config_sample) + self.include_sample_files(config_sample=config_sample, case_sample=case_sample) config_sample.father = ( case_sample.father.internal_id if case_sample.father @@ -114,13 +114,13 @@ def include_case_files(self) -> None: LOG.info(f"Scout key: {scout_key}") self._include_case_file(scout_key) - def include_sample_files(self, config_sample: ScoutIndividual = None) -> None: + def include_sample_files(self, case_sample: CaseSample, config_sample: ScoutIndividual = None, ) -> None: for scout_key in RAREDISEASE_SAMPLE_TAGS.keys(): LOG.info(f"Scout key: {scout_key}") scout_key = scout_key.replace("chromograph_", "chromograph_images.") scout_key = scout_key.replace("reviewer_", "reviewer.") - self._include_sample_file(scout_key) + self._include_sample_file(scout_key, case_sample) def _include_case_file(self, scout_key) -> None: """Include the file path associated to a scout configuration parameter if the corresponding housekeeper tags @@ -131,13 +131,14 @@ def _include_case_file(self, scout_key) -> None: self.get_file_from_hk(getattr(self.case_tags, scout_key)), ) - def _include_sample_file(self, scout_key) -> None: + def _include_sample_file(self, scout_key, case_sample) -> None: """Include the file path associated to a scout configuration parameter if the corresponding housekeeper tags are found. Otherwise return None.""" + tags = getattr(self.sample_tags, scout_key) setattr( self.load_config, scout_key, - self.get_file_from_hk(getattr(self.sample_tags, scout_key)), + self.get_sample_file(hk_tags=tags, sample_id=case_sample), ) @staticmethod diff --git a/cg/models/scout/scout_load_config.py b/cg/models/scout/scout_load_config.py index ddf1506849..78990ad4dc 100644 --- a/cg/models/scout/scout_load_config.py +++ b/cg/models/scout/scout_load_config.py @@ -68,7 +68,6 @@ class ScoutMipIndividual(ScoutIndividual): class ScoutRarediseaseIndividual(ScoutIndividual): - alignment_path: str | None = None mt_bam: str | None = None bam_file: str | None = None chromograph_autozyg: str | None = None