From 58994de8881fff8aaeceae83a137355a9de31b03 Mon Sep 17 00:00:00 2001 From: Annick Renevey <47788523+rannick@users.noreply.github.com> Date: Tue, 3 Sep 2024 16:37:54 +0200 Subject: [PATCH] differentiate case and sample tags --- .../upload/scout/raredisease_config_builder.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/cg/meta/upload/scout/raredisease_config_builder.py b/cg/meta/upload/scout/raredisease_config_builder.py index fc9475b502..a29bae0e59 100644 --- a/cg/meta/upload/scout/raredisease_config_builder.py +++ b/cg/meta/upload/scout/raredisease_config_builder.py @@ -112,14 +112,14 @@ def include_case_files(self) -> None: LOG.info("Including RAREDISEASE specific case level files") for scout_key in RAREDISEASE_CASE_TAGS.keys(): LOG.info(f"Scout key: {scout_key}") - self._include_file(scout_key) + self._include_case_file(scout_key) def include_sample_files(self, config_sample: ScoutIndividual = None) -> None: for scout_key in RAREDISEASE_SAMPLE_TAGS.keys(): scout_key = scout_key.replace("chromograph_", "chromograph_images.") - self._include_file(scout_key) + self._include_sample_file(scout_key) - def _include_file(self, scout_key) -> None: + def _include_case_file(self, scout_key) -> None: """Include the file path associated to a scout configuration parameter if the corresponding housekeeper tags are found. Otherwise return None.""" setattr( @@ -128,6 +128,15 @@ def _include_file(self, scout_key) -> None: self.get_file_from_hk(getattr(self.case_tags, scout_key)), ) + def _include_sample_file(self, scout_key) -> None: + """Include the file path associated to a scout configuration parameter if the corresponding housekeeper tags + are found. Otherwise return None.""" + setattr( + self.load_config, + scout_key, + self.get_file_from_hk(getattr(self.sample_tags, scout_key)), + ) + @staticmethod def is_family_case(load_config: ScoutLoadConfig) -> bool: """Check if there are any linked individuals in a case"""