Skip to content

Commit

Permalink
tox lint
Browse files Browse the repository at this point in the history
  • Loading branch information
yaseminbridges committed Jan 7, 2025
1 parent c6604ff commit 8930cd2
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 22 deletions.
10 changes: 7 additions & 3 deletions src/pheval/analyse/disease_prioritisation_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)

Expand Down
10 changes: 7 additions & 3 deletions src/pheval/analyse/gene_prioritisation_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)

Expand Down
34 changes: 19 additions & 15 deletions src/pheval/analyse/variant_prioritisation_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_analysis.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down

0 comments on commit 8930cd2

Please sign in to comment.