Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions cg/meta/upload/scout/raredisease_config_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ def build_load_config(self, hk_version: Version, analysis: Analysis) -> Raredise
)
load_config.sv_rank_model_url = sv_rank_model.path
load_config.sv_rank_model_version = sv_rank_model.version
load_config.saltshaker_report = self.get_file_from_hk(
hk_tags={"saltshaker-classify"}, hk_version=hk_version
)
Comment on lines +77 to +79

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did we consider adding this tag to the RAREDISEASE_CASE_TAGS? I do find the old pattern very confusing but I wonder if it will not be confusing as well to have the HK fetching done in a new way here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't find the old pattern useful. Although it is nice to have the tags listed centrally in one place, the use of that dictionary is confusing, and it entangles many parts of the code. I suspect its use was intended for something else

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not certain that the intent was anything but collecting all the tags in the same place (which I think might be nice preserving), but if you do not find it useful, feel free to do it like this.

return load_config

def _get_rank_model(self, hk_version: Version, variant_type: Variants) -> RankModel:
Expand Down
7 changes: 4 additions & 3 deletions cg/models/scout/scout_load_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,22 +183,23 @@ class NalloLoadConfig(ScoutLoadConfig):


class RarediseaseLoadConfig(ScoutLoadConfig):
custom_images: CustomImages | None = None
madeline: str | None = None
peddy_check: str | None = None
peddy_ped: str | None = None
peddy_sex: str | None = None
saltshaker_report: str | None = None
samples: list[ScoutRarediseaseIndividual] = []
custom_images: CustomImages | None = None
smn_tsv: str | None = None
vcf_mei: str | None = None
vcf_mei_research: str | None = None
vcf_snv: Annotated[str | None, AfterValidator(field_not_none)] = None
vcf_snv_research: Annotated[str | None, AfterValidator(field_not_none)] = None
vcf_snv_mt: str | None = None
vcf_snv_research: Annotated[str | None, AfterValidator(field_not_none)] = None
vcf_snv_research_mt: str | None = None
vcf_str: str | None = None
vcf_sv: Annotated[str | None, AfterValidator(field_not_none)] = None
vcf_sv_research: Annotated[str | None, AfterValidator(field_not_none)] = None
vcf_str: str | None = None


class RnafusionLoadConfig(ScoutLoadConfig):
Expand Down
4 changes: 4 additions & 0 deletions tests/meta/upload/scout/test_scout_config_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,7 @@ def test_raredisease_config_builder(mocker: MockerFixture):
chromograph_autozyg: File = create_autospec(File, full_path="chromograph_autozyg_chr9.png")
chromograph_coverage: File = create_autospec(File, full_path="chromograph_coverage_chr9.png")
saltshaker_path: File = create_autospec(File, full_path="saltshaker.png")
saltshaker_report: File = create_autospec(File, full_path="saltshaker_report.html")
chromograph_regions: File = create_autospec(File, full_path="chromograph_regions.bed")
chromograph_sites: File = create_autospec(File, full_path="chromograph_sites.bed")
reviewer_alignment: File = create_autospec(File, full_path="reviewer_alignment.vcf")
Expand All @@ -620,6 +621,8 @@ def mock_get_file_from_version(version: Version, tags: set[str]) -> File | None:
return peddy_check
if tags == {"ped", "peddy"}:
return peddy_ped
if tags == {"saltshaker-classify"}:
return saltshaker_report
if tags == {"sex-check", "peddy"}:
return peddy_sex
if tags == {"smn-calling"}:
Expand Down Expand Up @@ -749,6 +752,7 @@ def mock_get_file_from_version(version: Version, tags: set[str]) -> File | None:
rank_model_url=snv_rank_model.full_path,
sv_rank_model_version="2.0",
sv_rank_model_url=sv_rank_model.full_path,
saltshaker_report=saltshaker_report.full_path,
analysis_date=datetime.now(),
samples=[
ScoutRarediseaseIndividual(
Expand Down
Loading
Loading