Skip to content

Commit

Permalink
Merge pull request #290 from monarch-initiative/288-fixing-param-name…
Browse files Browse the repository at this point in the history
…-in-semsim-to-exomiserdb-utils-cli-command

 Fixing param name in semsim-to-exomiserdb utils cli command
  • Loading branch information
souzadevinicius authored Jan 30, 2024
2 parents 8e90385 + 249b738 commit c47cfe8
Show file tree
Hide file tree
Showing 13 changed files with 51 additions and 25 deletions.
16 changes: 10 additions & 6 deletions src/pheval/analyse/disease_prioritisation_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,16 +170,20 @@ def assess_disease_prioritisation(
disease_match = self._record_matched_disease(
disease, rank_stats, standardised_disease_result
)
relevant_ranks.append(
disease_match.rank
) if disease_match else relevant_ranks.append(0)
(
relevant_ranks.append(disease_match.rank)
if disease_match
else relevant_ranks.append(0)
)
break
PrioritisationRankRecorder(
rank_stats.total,
self.results_dir,
DiseasePrioritisationResult(self.phenopacket_path, disease)
if disease_match is None
else disease_match,
(
DiseasePrioritisationResult(self.phenopacket_path, disease)
if disease_match is None
else disease_match
),
rank_records,
).record_rank()
rank_stats.relevant_result_ranks.append(relevant_ranks)
Expand Down
14 changes: 9 additions & 5 deletions src/pheval/analyse/gene_prioritisation_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,16 +161,20 @@ def assess_gene_prioritisation(self, rank_stats: RankStats, rank_records: defaul
gene_match = self._record_matched_gene(
gene, rank_stats, standardised_gene_result
)
relevant_ranks.append(gene_match.rank) if gene_match else relevant_ranks.append(
0
(
relevant_ranks.append(gene_match.rank)
if gene_match
else relevant_ranks.append(0)
)
break
PrioritisationRankRecorder(
rank_stats.total,
self.results_dir,
GenePrioritisationResult(self.phenopacket_path, gene.gene_symbol)
if gene_match is None
else gene_match,
(
GenePrioritisationResult(self.phenopacket_path, gene.gene_symbol)
if gene_match is None
else gene_match
),
rank_records,
).record_rank()
rank_stats.relevant_result_ranks.append(relevant_ranks)
Expand Down
16 changes: 10 additions & 6 deletions src/pheval/analyse/variant_prioritisation_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,16 +164,20 @@ def assess_variant_prioritisation(
)
if variant == result_variant:
variant_match = self._record_matched_variant(rank_stats, result)
relevant_ranks.append(
variant_match.rank
) if variant_match else relevant_ranks.append(0)
(
relevant_ranks.append(variant_match.rank)
if variant_match
else relevant_ranks.append(0)
)
break
PrioritisationRankRecorder(
rank_stats.total,
self.results_dir,
VariantPrioritisationResult(self.phenopacket_path, variant)
if variant_match is None
else variant_match,
(
VariantPrioritisationResult(self.phenopacket_path, variant)
if variant_match is None
else variant_match
),
rank_records,
).record_rank()
rank_stats.relevant_result_ranks.append(relevant_ranks)
Expand Down
1 change: 1 addition & 0 deletions src/pheval/cli.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""PhEval CLI Module """

import logging

import click
Expand Down
1 change: 1 addition & 0 deletions src/pheval/cli_pheval.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Monarch Initiative
"""

from pathlib import Path

import click
Expand Down
1 change: 1 addition & 0 deletions src/pheval/implementations/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""implementations"""

from functools import cache

from class_resolver import ClassResolver
Expand Down
8 changes: 5 additions & 3 deletions src/pheval/prepare/create_spiked_vcf.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,11 @@ def construct_variant_entry(self, proband_variant_data: ProbandCausativeVariant)
str(proband_variant_data.variant.pos),
".",
proband_variant_data.variant.ref,
f"<{proband_variant_data.variant.alt}>"
if proband_variant_data.variant.ref == "N"
else proband_variant_data.variant.alt,
(
f"<{proband_variant_data.variant.alt}>"
if proband_variant_data.variant.ref == "N"
else proband_variant_data.variant.alt
),
"100",
"PASS",
proband_variant_data.info if proband_variant_data.info else ".",
Expand Down
1 change: 1 addition & 0 deletions src/pheval/runners/runner.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Runners Module"""

from abc import ABC, abstractmethod
from dataclasses import dataclass
from datetime import datetime
Expand Down
1 change: 1 addition & 0 deletions src/pheval/utils/docs_gen.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""docs generate utils"""

import ast
import os
import shutil
Expand Down
14 changes: 9 additions & 5 deletions src/pheval/utils/phenopacket_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,12 +301,16 @@ def _diagnosis_from_interpretations(self) -> List[ProbandDisease]:
diagnoses = []
interpretation = self.interpretations()
for i in interpretation:
diagnoses.append(
ProbandDisease(
disease_name=i.diagnosis.disease.label,
disease_identifier=i.diagnosis.disease.id,
(
diagnoses.append(
ProbandDisease(
disease_name=i.diagnosis.disease.label,
disease_identifier=i.diagnosis.disease.id,
)
)
) if i.diagnosis.disease.label != "" and i.diagnosis.disease.id != "" else None
if i.diagnosis.disease.label != "" and i.diagnosis.disease.id != ""
else None
)
return diagnoses

def _diagnosis_from_disease(self) -> List[ProbandDisease]:
Expand Down
1 change: 1 addition & 0 deletions src/pheval/utils/semsim_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Contains all pheval utility methods
"""

from pathlib import Path

import numpy
Expand Down
1 change: 1 addition & 0 deletions src/pheval/utils/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Contains all pheval utility methods"""

import logging
import random
from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""CLI Test """

import logging
import shutil
import tempfile
Expand Down

0 comments on commit c47cfe8

Please sign in to comment.