Skip to content

Commit 8930cd2

Browse files
committedJan 7, 2025
tox lint
1 parent c6604ff commit 8930cd2

4 files changed

+34
-22
lines changed
 

‎src/pheval/analyse/disease_prioritisation_analysis.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,13 @@ def assess_disease_prioritisation(
6464
elif len(result) == 0:
6565
relevant_ranks.append(0)
6666
binary_classification_stats.add_classification(
67-
self.db_connection.parse_table_into_dataclass(
68-
str(standardised_disease_result_path), RankedPhEvalDiseaseResult
69-
) if standardised_disease_result_path.exists() else [],
67+
(
68+
self.db_connection.parse_table_into_dataclass(
69+
str(standardised_disease_result_path), RankedPhEvalDiseaseResult
70+
)
71+
if standardised_disease_result_path.exists()
72+
else []
73+
),
7074
relevant_ranks,
7175
)
7276

‎src/pheval/analyse/gene_prioritisation_analysis.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,13 @@ def assess_gene_prioritisation(
6161
if not result:
6262
relevant_ranks.append(0)
6363
binary_classification_stats.add_classification(
64-
self.db_connection.parse_table_into_dataclass(
65-
str(standardised_gene_result_path), RankedPhEvalGeneResult
66-
) if standardised_gene_result_path.exists() else [],
64+
(
65+
self.db_connection.parse_table_into_dataclass(
66+
str(standardised_gene_result_path), RankedPhEvalGeneResult
67+
)
68+
if standardised_gene_result_path.exists()
69+
else []
70+
),
6771
relevant_ranks,
6872
)
6973

‎src/pheval/analyse/variant_prioritisation_analysis.py

+19-15
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ class AssessVariantPrioritisation(AssessPrioritisationBase):
1515
"""Class for assessing variant prioritisation based on thresholds and scoring orders."""
1616

1717
def assess_variant_prioritisation(
18-
self,
19-
standardised_variant_result_path: Path,
20-
phenopacket_path: Path,
21-
binary_classification_stats: BinaryClassificationStats,
18+
self,
19+
standardised_variant_result_path: Path,
20+
phenopacket_path: Path,
21+
binary_classification_stats: BinaryClassificationStats,
2222
) -> None:
2323
"""
2424
Assess variant prioritisation.
@@ -73,18 +73,22 @@ def assess_variant_prioritisation(
7373
elif len(result) == 0:
7474
relevant_ranks.append(0)
7575
binary_classification_stats.add_classification(
76-
self.db_connection.parse_table_into_dataclass(
77-
str(standardised_variant_result_path), RankedPhEvalVariantResult
78-
) if standardised_variant_result_path.exists() else [],
76+
(
77+
self.db_connection.parse_table_into_dataclass(
78+
str(standardised_variant_result_path), RankedPhEvalVariantResult
79+
)
80+
if standardised_variant_result_path.exists()
81+
else []
82+
),
7983
relevant_ranks,
8084
)
8185

8286

8387
def assess_phenopacket_variant_prioritisation(
84-
phenopacket_path: Path,
85-
run: RunConfig,
86-
variant_binary_classification_stats: BinaryClassificationStats,
87-
variant_benchmarker: AssessVariantPrioritisation,
88+
phenopacket_path: Path,
89+
run: RunConfig,
90+
variant_binary_classification_stats: BinaryClassificationStats,
91+
variant_benchmarker: AssessVariantPrioritisation,
8892
) -> None:
8993
"""
9094
Assess variant prioritisation for a Phenopacket by comparing PhEval standardised variant results
@@ -107,10 +111,10 @@ def assess_phenopacket_variant_prioritisation(
107111

108112

109113
def benchmark_variant_prioritisation(
110-
benchmark_name: str,
111-
run: RunConfig,
112-
score_order: str,
113-
threshold: float,
114+
benchmark_name: str,
115+
run: RunConfig,
116+
score_order: str,
117+
threshold: float,
114118
):
115119
"""
116120
Benchmark a directory based on variant prioritisation results.

‎tests/test_analysis.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import unittest
22
from copy import copy
33
from pathlib import Path
4-
from unittest.mock import patch, MagicMock
4+
from unittest.mock import MagicMock, patch
55

66
import duckdb
77

0 commit comments

Comments
 (0)