Skip to content

Commit

Permalink
Merge pull request #256 from monarch-initiative/enhance-phenotype-pre…
Browse files Browse the repository at this point in the history
…dicate-tests

Test phenotype predicate utility methods
  • Loading branch information
ielis committed Sep 10, 2024
2 parents a966998 + 3d376f1 commit 90b2d0e
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions tests/analysis/predicate/test_phenotype.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import hpotk

from gpsea.model import Cohort

from gpsea.analysis.predicate.phenotype import PhenotypePolyPredicate
from gpsea.analysis.predicate.phenotype import prepare_hpo_terms_of_interest, prepare_predicates_for_terms_of_interest


def test_prepare_hpo_terms_of_interest(
suox_cohort: Cohort,
hpo: hpotk.MinimalOntology,
):
terms = prepare_hpo_terms_of_interest(
cohort=suox_cohort,
hpo=hpo,
)

assert len(terms) == 66


def test_prepare_predicates_for_terms_of_interest(
suox_cohort: Cohort,
hpo: hpotk.MinimalOntology,
):
predicates = prepare_predicates_for_terms_of_interest(
cohort=suox_cohort,
hpo=hpo,
)

assert len(predicates) == 66
assert all(isinstance(p, PhenotypePolyPredicate) for p in predicates)

0 comments on commit 90b2d0e

Please sign in to comment.