Skip to content

Commit

Permalink
add sample id to hk tage
Browse files Browse the repository at this point in the history
  • Loading branch information
rannick committed Sep 3, 2024
1 parent 7512278 commit aef457e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
11 changes: 6 additions & 5 deletions cg/meta/upload/scout/raredisease_config_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
1 change: 0 additions & 1 deletion cg/models/scout/scout_load_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit aef457e

Please sign in to comment.