Skip to content

Commit

Permalink
differentiate case and sample tags
Browse files Browse the repository at this point in the history
  • Loading branch information
rannick committed Sep 3, 2024
1 parent 43d4c04 commit 58994de
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions cg/meta/upload/scout/raredisease_config_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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"""
Expand Down

0 comments on commit 58994de

Please sign in to comment.