Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,7 @@ For development, use `poetry install --all-extras` to install development depend
[codefactor-badge]: https://www.codefactor.io/repository/github/clinical-genomics/cg/badge
[codefactor-url]: https://www.codefactor.io/repository/github/clinical-genomics/cg
[black-image]: https://img.shields.io/badge/code%20style-black-000000.svg
[black-url]: https://github.com/psf/black
[black-url]: https://github.com/psf/black

Old codes find the light, Newer maps trace hidden flaws, Healing with data.

Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@


class RarediseaseParamsFileCreator(ParamsFileCreator):

def __init__(self, store: Store, lims: LimsAPI, params: str):
super().__init__(params)
self.store = store
Expand Down Expand Up @@ -91,7 +90,7 @@ def _get_target_bed_from_lims(self, case_id: str) -> str:
if target_bed_shortname:
bed_version: BedVersion = (
self.store.get_bed_version_by_short_name_and_genome_version_strict(
short_name=target_bed_shortname, genome_version=BedVersionGenomeVersion.HG19
short_name=target_bed_shortname, genome_version=BedVersionGenomeVersion.HG38
)
)
return bed_version.filename
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def get_genome_build(workflow: Workflow) -> GenePanelGenomeBuild | None:
workflow_to_genome_build: dict[Workflow, GenePanelGenomeBuild] = {
Workflow.MIP_DNA: GenePanelGenomeBuild.hg19,
Workflow.NALLO: GenePanelGenomeBuild.hg38,
Workflow.RAREDISEASE: GenePanelGenomeBuild.hg19,
Workflow.RAREDISEASE: GenePanelGenomeBuild.hg38,
Workflow.TOMTE: GenePanelGenomeBuild.hg38,
}
return workflow_to_genome_build.get(workflow)
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def _get_managed_variants_file_creator(self, workflow: Workflow) -> ManagedVaria
def _get_scout_api(self, workflow: Workflow) -> ScoutAPI:
return (
self.cg_config.scout_api_38
if workflow == Workflow.NALLO
if workflow in [Workflow.NALLO, Workflow.RAREDISEASE]
else self.cg_config.scout_api_37
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def test_raredisease_params_file_creator(
lambda short_name, genome_version: (
create_autospec(BedVersion, filename="bed_version.bed")
if short_name == "target_bed_shortname_123"
and genome_version == BedVersionGenomeVersion.HG19
and genome_version == BedVersionGenomeVersion.HG38
else create_autospec(BedVersion)
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def test_add_gene_panels_in_combo(
"case_id, expected_genome_build",
[
(MIP_DNA_CASE_ID, GenePanelGenomeBuild.hg19),
(RAREDISEASE_CASE_ID, GenePanelGenomeBuild.hg19),
(RAREDISEASE_CASE_ID, GenePanelGenomeBuild.hg38),
(NALLO_CASE_ID, GenePanelGenomeBuild.hg38),
(TOMTE_CASE_ID, GenePanelGenomeBuild.hg38),
],
Expand Down
46 changes: 44 additions & 2 deletions tests/services/analysis_starter/test_configurator_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ def test_get_microsalt_configurator(cg_context: CGConfig):
@pytest.mark.parametrize(
"workflow, pipeline_extension_class",
[
(Workflow.NALLO, NalloExtension),
(Workflow.RAREDISEASE, RarediseaseExtension),
(Workflow.RNAFUSION, PipelineExtension),
(Workflow.TAXPROFILER, PipelineExtension),
(Workflow.TOMTE, TomteExtension),
Expand All @@ -109,6 +107,50 @@ def test_nextflow_configurator_factory_success(
assert isinstance(configurator.pipeline_extension, pipeline_extension_class)


def test_nextflow_configurator_factory_raredisease_success(
cg_context: CGConfig,
):
# GIVEN a configurator factory
configurator_factory = ConfiguratorFactory(cg_config=cg_context)

# WHEN getting the configurator for the workflow
configurator = cast(
NextflowConfigurator, configurator_factory.get_configurator(Workflow.RAREDISEASE)
)

# THEN the configurator is of the expected type
assert isinstance(configurator, NextflowConfigurator)
assert isinstance(configurator.params_file_creator, ParamsFileCreator)
assert isinstance(configurator.sample_sheet_creator, SampleSheetCreator)
assert isinstance(configurator.pipeline_extension, RarediseaseExtension)
assert (
configurator.pipeline_extension.gene_panel_file_creator.scout_api == cg_context.scout_api_38
)
assert (
configurator.pipeline_extension.managed_variants_file_creator.scout_api
== cg_context.scout_api_38
)


def test_nextflow_configurator_factory_nallo_success(
cg_context: CGConfig,
):
# GIVEN a configurator factory
configurator_factory = ConfiguratorFactory(cg_config=cg_context)

# WHEN getting the configurator for the workflow
configurator = cast(NextflowConfigurator, configurator_factory.get_configurator(Workflow.NALLO))

# THEN the configurator is of the expected type
assert isinstance(configurator, NextflowConfigurator)
assert isinstance(configurator.params_file_creator, ParamsFileCreator)
assert isinstance(configurator.sample_sheet_creator, SampleSheetCreator)
assert isinstance(configurator.pipeline_extension, NalloExtension)
assert (
configurator.pipeline_extension.gene_panel_file_creator.scout_api == cg_context.scout_api_38
)


def test_get_mip_dna_configurator():
# GIVEN a MIP-DNA config
mip_config: MipConfig = create_autospec(
Expand Down
Loading