diff --git a/cg/meta/workflow/raredisease.py b/cg/meta/workflow/raredisease.py index b732f669cc..a51ca3d201 100644 --- a/cg/meta/workflow/raredisease.py +++ b/cg/meta/workflow/raredisease.py @@ -107,7 +107,8 @@ def get_pipeline_parameters(self, case_id: str) -> PipelineParameters: outdir=self.get_case_path(case_id=case_id), ) - def get_phenotype_code(self, phenotype: str) -> int: + @staticmethod + def get_phenotype_code(phenotype: str) -> int: """Return Raredisease phenotype code.""" LOG.debug("Translate phenotype to int") if phenotype == "unaffected": @@ -117,9 +118,10 @@ def get_phenotype_code(self, phenotype: str) -> int: else: return 0 - def get_sex_code(self, sex: str) -> int: - """Return Raredisease phenotype code.""" - LOG.debug("Translate phenotype to int") + @staticmethod + def get_sex_code(sex: str) -> int: + """Return Raredisease sex code.""" + LOG.debug("Translate sex to int") if sex == "male": return 1 elif sex == "female": @@ -127,13 +129,11 @@ def get_sex_code(self, sex: str) -> int: else: return 0 - def get_parental_id(self, parent: CaseSample) -> str: - """Return Raredisease phenotype code.""" - LOG.debug("Translate phenotype to int") - if parent: - return parent.internal_id - else: - return "" + @staticmethod + def get_parental_id(parent: CaseSample) -> str: + """Return Raredisease parental id.""" + LOG.debug("Return parental id") + return parent.internal_id if parent else "" @property def root(self) -> str: diff --git a/tests/meta/workflow/test_prepare_fastq_api.py b/tests/meta/workflow/test_prepare_fastq_api.py index 232a45ad9a..c6594627c2 100644 --- a/tests/meta/workflow/test_prepare_fastq_api.py +++ b/tests/meta/workflow/test_prepare_fastq_api.py @@ -190,7 +190,11 @@ def test_add_decompressed_sample_loops_through_spring( case = analysis_store.get_case_by_internal_id(case_id) sample = case.samples[0] - with mock.patch.object(files, "get_hk_files_dict", return_value={},), mock.patch.object( + with mock.patch.object( + files, + "get_hk_files_dict", + return_value={}, + ), mock.patch.object( files, "get_spring_paths", return_value=[CompressionData(spring_file.with_suffix(""))],