diff --git a/src/pheval/analyse/disease_prioritisation_analysis.py b/src/pheval/analyse/disease_prioritisation_analysis.py index c3c42536..0b6d5c47 100644 --- a/src/pheval/analyse/disease_prioritisation_analysis.py +++ b/src/pheval/analyse/disease_prioritisation_analysis.py @@ -64,9 +64,13 @@ def assess_disease_prioritisation( elif len(result) == 0: relevant_ranks.append(0) binary_classification_stats.add_classification( - self.db_connection.parse_table_into_dataclass( - str(standardised_disease_result_path), RankedPhEvalDiseaseResult - ) if standardised_disease_result_path.exists() else [], + ( + self.db_connection.parse_table_into_dataclass( + str(standardised_disease_result_path), RankedPhEvalDiseaseResult + ) + if standardised_disease_result_path.exists() + else [] + ), relevant_ranks, ) diff --git a/src/pheval/analyse/gene_prioritisation_analysis.py b/src/pheval/analyse/gene_prioritisation_analysis.py index 4be04a72..55b47ff9 100644 --- a/src/pheval/analyse/gene_prioritisation_analysis.py +++ b/src/pheval/analyse/gene_prioritisation_analysis.py @@ -61,9 +61,13 @@ def assess_gene_prioritisation( if not result: relevant_ranks.append(0) binary_classification_stats.add_classification( - self.db_connection.parse_table_into_dataclass( - str(standardised_gene_result_path), RankedPhEvalGeneResult - ) if standardised_gene_result_path.exists() else [], + ( + self.db_connection.parse_table_into_dataclass( + str(standardised_gene_result_path), RankedPhEvalGeneResult + ) + if standardised_gene_result_path.exists() + else [] + ), relevant_ranks, ) diff --git a/src/pheval/analyse/variant_prioritisation_analysis.py b/src/pheval/analyse/variant_prioritisation_analysis.py index 6835bb4e..0f26bf72 100644 --- a/src/pheval/analyse/variant_prioritisation_analysis.py +++ b/src/pheval/analyse/variant_prioritisation_analysis.py @@ -15,10 +15,10 @@ class AssessVariantPrioritisation(AssessPrioritisationBase): """Class for assessing variant prioritisation based on thresholds and scoring orders.""" def assess_variant_prioritisation( - self, - standardised_variant_result_path: Path, - phenopacket_path: Path, - binary_classification_stats: BinaryClassificationStats, + self, + standardised_variant_result_path: Path, + phenopacket_path: Path, + binary_classification_stats: BinaryClassificationStats, ) -> None: """ Assess variant prioritisation. @@ -73,18 +73,22 @@ def assess_variant_prioritisation( elif len(result) == 0: relevant_ranks.append(0) binary_classification_stats.add_classification( - self.db_connection.parse_table_into_dataclass( - str(standardised_variant_result_path), RankedPhEvalVariantResult - ) if standardised_variant_result_path.exists() else [], + ( + self.db_connection.parse_table_into_dataclass( + str(standardised_variant_result_path), RankedPhEvalVariantResult + ) + if standardised_variant_result_path.exists() + else [] + ), relevant_ranks, ) def assess_phenopacket_variant_prioritisation( - phenopacket_path: Path, - run: RunConfig, - variant_binary_classification_stats: BinaryClassificationStats, - variant_benchmarker: AssessVariantPrioritisation, + phenopacket_path: Path, + run: RunConfig, + variant_binary_classification_stats: BinaryClassificationStats, + variant_benchmarker: AssessVariantPrioritisation, ) -> None: """ Assess variant prioritisation for a Phenopacket by comparing PhEval standardised variant results @@ -107,10 +111,10 @@ def assess_phenopacket_variant_prioritisation( def benchmark_variant_prioritisation( - benchmark_name: str, - run: RunConfig, - score_order: str, - threshold: float, + benchmark_name: str, + run: RunConfig, + score_order: str, + threshold: float, ): """ Benchmark a directory based on variant prioritisation results. diff --git a/tests/test_analysis.py b/tests/test_analysis.py index 12811019..7e6bbc8f 100644 --- a/tests/test_analysis.py +++ b/tests/test_analysis.py @@ -1,7 +1,7 @@ import unittest from copy import copy from pathlib import Path -from unittest.mock import patch, MagicMock +from unittest.mock import MagicMock, patch import duckdb