Skip to content

Commit

Permalink
Raredisease: add gene panel to workflow start (#3772)
Browse files Browse the repository at this point in the history
### Added
- cg workflow raredisease config case forces gene panel generation

### Changed
- Allow hg19 as input for raredisease managed variants
  • Loading branch information
peterpru authored Sep 26, 2024
1 parent 68ccc73 commit f930518
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cg/meta/workflow/raredisease.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ def get_sample_sheet_content_per_sample(self, case_sample: CaseSample) -> list[l
)
return sample_sheet_entry.reformat_sample_content

@property
def is_gene_panel_required(self) -> bool:
"""Return True if a gene panel is needs to be created using the information in StatusDB and exporting it from Scout."""
return True

def get_target_bed(self, case_id: str, analysis_type: str) -> str:
"""
Return the target bed file from LIMS and use default capture kit for WGS.
Expand Down Expand Up @@ -160,7 +165,9 @@ def write_managed_variants(self, case_id: str, content: list[str]) -> None:

def get_managed_variants(self, case_id: str) -> list[str]:
"""Create and return the managed variants."""
return self._get_managed_variants(genome_build=self.get_genome_build(case_id=case_id))
return self._get_managed_variants(
genome_build=self.get_gene_panel_genome_build(case_id=case_id)
)

def get_workflow_metrics(self, sample_id: str) -> dict:
"""Return Raredisease workflow metric conditions for a sample."""
Expand Down
9 changes: 9 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2499,6 +2499,12 @@ def raredisease_params_file_path(raredisease_dir, raredisease_case_id) -> Path:
).with_suffix(FileExtensions.YAML)


@pytest.fixture(scope="function")
def raredisease_gene_panel_path(raredisease_dir, raredisease_case_id) -> Path:
"""Path to gene panel file."""
return Path(raredisease_dir, raredisease_case_id, "gene_panels").with_suffix(FileExtensions.BED)


@pytest.fixture(scope="function")
def raredisease_nexflow_config_file_path(raredisease_dir, raredisease_case_id) -> Path:
"""Path to config file."""
Expand Down Expand Up @@ -2601,6 +2607,7 @@ def raredisease_context(
last_sequenced_at=datetime.now(),
reads=total_sequenced_reads_pass,
application_tag=wgs_application_tag,
reference_genome=GenomeVersion.HG19,
)

another_sample_enough_reads: Sample = helpers.add_sample(
Expand All @@ -2610,6 +2617,7 @@ def raredisease_context(
last_sequenced_at=datetime.now(),
reads=total_sequenced_reads_pass,
application_tag=wgs_application_tag,
reference_genome=GenomeVersion.HG19,
)

helpers.add_relationship(
Expand Down Expand Up @@ -2638,6 +2646,7 @@ def raredisease_context(
last_sequenced_at=datetime.now(),
reads=total_sequenced_reads_not_pass,
application_tag=wgs_application_tag,
reference_genome=GenomeVersion.HG19,
)

helpers.add_relationship(status_db, case=case_not_enough_reads, sample=sample_not_enough_reads)
Expand Down

0 comments on commit f930518

Please sign in to comment.