diff --git a/README.md b/README.md
index 449314b9e..c4b00093d 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@
![PyPi downloads](https://img.shields.io/pypi/dm/gpsea.svg?label=Pypi%20downloads)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/gpsea)
-GPSEA (Genotypes and Ghenotypes - Statistical Evaluation of Associations, pronounced "G"-"P"-"C") is a Python package designed to support genotype-phenotype correlation analysis.
+GPSEA (Genotypes and Phenotypes - Statistical Evaluation of Associations, pronounced "G"-"P"-"C") is a Python package designed to support genotype-phenotype correlation analysis.
See the [Tutorial](https://monarch-initiative.github.io/gpsea/stable/tutorial.html)
diff --git a/docs/index.rst b/docs/index.rst
index b70bf9c28..5bcadd386 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -10,7 +10,7 @@ A key question in biology and human genetics concerns the relationships between
genetics, the focus is generally placed on the study of whether specific disease-causing alleles are associated with specific phenotypic
manifestations of the disease.
-`GPSEA` (Genotypes and Ghenotypes - Statistical Evaluation of Associations, pronounced "G"-"P"-"C") is a Python package designed to support genotype-phenotype correlation analysis.
+`GPSEA` (Genotypes and Phenotypes - Statistical Evaluation of Associations, pronounced "G"-"P"-"C") is a Python package designed to support genotype-phenotype correlation analysis.
The input to `GPSEA` is a collection of `Global Alliance for Genomics and Health (GA4GH) Phenopackets `_.
`gpsea` ingests data from these phenopackets and performs analysis of the correlation of specific variants,
variant types (e.g., missense vs. premature termination codon), or variant location in protein motifs or other features.
diff --git a/docs/report/tbx5_frameshift_vs_missense.csv b/docs/report/tbx5_frameshift_vs_missense.csv
index 0bc1e5c6c..4ab9175ad 100644
--- a/docs/report/tbx5_frameshift_vs_missense.csv
+++ b/docs/report/tbx5_frameshift_vs_missense.csv
@@ -1,4 +1,4 @@
-"Genotype group: Missense, Frameshift",Missense,Missense,Frameshift,Frameshift,,
+Genotype group,Missense,Missense,Frameshift,Frameshift,,
,Count,Percent,Count,Percent,Corrected p values,p values
Ventricular septal defect [HP:0001629],31/60,52%,19/19,100%,0.0009552459156234353,5.6190936213143254e-05
Abnormal atrioventricular conduction [HP:0005150],0/22,0%,3/3,100%,0.003695652173913043,0.00043478260869565214
@@ -13,10 +13,10 @@ Muscular ventricular septal defect [HP:0011623],6/59,10%,6/25,24%,0.286867598598
Pulmonary arterial hypertension [HP:0002092],4/6,67%,0/2,0%,0.6623376623376622,0.42857142857142855
Hypoplasia of the ulna [HP:0003022],1/12,8%,2/10,20%,0.8095238095238093,0.5714285714285713
Hypoplasia of the radius [HP:0002984],30/62,48%,6/14,43%,1.0,0.7735491022101784
-Short thumb [HP:0009778],11/41,27%,8/30,27%,1.0,1.0
-Absent radius [HP:0003974],7/32,22%,6/25,24%,1.0,1.0
Short humerus [HP:0005792],7/17,41%,4/9,44%,1.0,1.0
+Short thumb [HP:0009778],11/41,27%,8/30,27%,1.0,1.0
Atrial septal defect [HP:0001631],42/44,95%,20/20,100%,1.0,1.0
-Abnormal ventricular septum morphology [HP:0010438],31/31,100%,19/19,100%,,
-Abnormal cardiac ventricle morphology [HP:0001713],31/31,100%,19/19,100%,,
-Abnormal heart morphology [HP:0001627],62/62,100%,30/30,100%,,
+Absent radius [HP:0003974],7/32,22%,6/25,24%,1.0,1.0
+Aplasia/Hypoplasia of the thumb [HP:0009601],20/20,100%,19/19,100%,,
+Aplasia/Hypoplasia of fingers [HP:0006265],22/22,100%,19/19,100%,,
+Aplasia/hypoplasia involving bones of the hand [HP:0005927],22/22,100%,19/19,100%,,
diff --git a/docs/user-guide/predicates.rst b/docs/user-guide/predicates.rst
index ed63f9d3b..bfd533b78 100644
--- a/docs/user-guide/predicates.rst
+++ b/docs/user-guide/predicates.rst
@@ -25,8 +25,6 @@ use the HPO terms to assign a group.
All GPSEA analyses need at least one predicate (typically a *genotype* predicate) and many require both *genotype* and *phenotype* predicates.
The following pages provide more information.
-.. _genotype-predicates:
-
.. toctree::
@@ -37,35 +35,6 @@ The following pages provide more information.
predicates/genotype_predicates
-
-
-.. _groups-predicate:
-
-
-
-.. _phenotype-predicates:
-
-
-
-
-Predicates for all cohort phenotypes
-====================================
-
-Constructing phenotype predicates for all HPO terms of a cohort sounds a bit tedious.
-The :func:`~gpsea.analysis.predicate.phenotype.prepare_predicates_for_terms_of_interest`
-function cuts down the tedium:
-
->>> from gpsea.analysis.predicate.phenotype import prepare_predicates_for_terms_of_interest
->>> pheno_predicates = prepare_predicates_for_terms_of_interest(
-... cohort=cohort,
-... hpo=hpo,
-... )
->>> len(pheno_predicates)
-301
-
-and prepares predicates for testing 301 HPO terms of the *RERE* cohort.
-
-
*******
Gallery
*******
diff --git a/docs/user-guide/predicates/diagnosis_predicate.rst b/docs/user-guide/predicates/diagnosis_predicate.rst
index 6ce811ab5..386af20a0 100644
--- a/docs/user-guide/predicates/diagnosis_predicate.rst
+++ b/docs/user-guide/predicates/diagnosis_predicate.rst
@@ -1,4 +1,4 @@
-.. _diagnosis_predicate:
+.. _diagnosis-predicate:
========================
Partition by a diagnosis
diff --git a/docs/user-guide/predicates/filtering_predicate.rst b/docs/user-guide/predicates/filtering_predicate.rst
index 2d47e1d39..a5acef316 100644
--- a/docs/user-guide/predicates/filtering_predicate.rst
+++ b/docs/user-guide/predicates/filtering_predicate.rst
@@ -35,7 +35,7 @@ to bin according to a genotype group:
>>> from gpsea.analysis.predicate.genotype import ModeOfInheritancePredicate
>>> gt_predicate = ModeOfInheritancePredicate.autosomal_recessive(is_frameshift_or_stop_gain)
>>> gt_predicate.display_question()
-'What is the genotype group?: HOM_REF, HET, BIALLELIC_ALT'
+'What is the genotype group: HOM_REF, HET, BIALLELIC_ALT'
We see that the `gt_predicate` bins the patients into three groups:
@@ -53,4 +53,4 @@ that includes only the categories of interest:
... targets=(cats[1], cats[2]),
... )
>>> fgt_predicate.display_question()
-'What is the genotype group?: HET, BIALLELIC_ALT'
\ No newline at end of file
+'What is the genotype group: HET, BIALLELIC_ALT'
\ No newline at end of file
diff --git a/docs/user-guide/predicates/genotype_predicates.rst b/docs/user-guide/predicates/genotype_predicates.rst
index 8a725b6ee..70fe391dc 100644
--- a/docs/user-guide/predicates/genotype_predicates.rst
+++ b/docs/user-guide/predicates/genotype_predicates.rst
@@ -1,4 +1,4 @@
-.. _genotype_predicates:
+.. _genotype-predicates:
===================
Genotype Predicates
diff --git a/docs/user-guide/predicates/groups_predicate.rst b/docs/user-guide/predicates/groups_predicate.rst
index 23f178ac0..a61428976 100644
--- a/docs/user-guide/predicates/groups_predicate.rst
+++ b/docs/user-guide/predicates/groups_predicate.rst
@@ -1,4 +1,4 @@
-.. _groups_predicate:
+.. _groups-predicate:
================
Groups Predicate
@@ -7,8 +7,8 @@ Groups Predicate
Sometimes, all we want is to compare if there is a difference between individuals
-who include one or more alleles of variant $X$ vs. individuals with variants $Y$,
-vs. individuals with variants $Z$, where $X$, $Y$ and $Z$ are variant predicates.
+who include one or more alleles of variant `X` vs. individuals with variants `Y`,
+vs. individuals with variants `Z`, where `X`, `Y` and `Z` are variant predicates.
We can do this with a *groups* predicate.
The :func:`~gpsea.analysis.predicate.genotype.groups_predicate`
diff --git a/docs/user-guide/predicates/hpo_predicate.rst b/docs/user-guide/predicates/hpo_predicate.rst
index fada58ec0..eaca60dca 100644
--- a/docs/user-guide/predicates/hpo_predicate.rst
+++ b/docs/user-guide/predicates/hpo_predicate.rst
@@ -1,10 +1,10 @@
-.. _hpo_predicate:
+.. _hpo-predicate:
-Propagating phenotype predicate
-===============================
+HPO predicate
+=============
-When testing for presence or absence of an HPO term, the propagating phenotype predicate
+When testing for presence or absence of an HPO term, the :class:`~gpsea.analysis.predicate.phenotype.HpoPredicate`
leverages the :ref:`true-path-rule` to take advantage of the HPO hierarchy.
In result, an individual annotated with a term is implicitly annotated with all its ancestors.
For instance, an individual annotated with `Ectopia lentis `_
@@ -15,14 +15,19 @@ is also annotated with `Abnormal lens morphology `_.
+We need to load :class:`~hpotk.MinimalOntology` with HPO data to access the HPO hierarchy:
+
+>>> import hpotk
+>>> store = hpotk.configure_ontology_store()
+>>> hpo = store.load_minimal_hpo(release='v2024-07-01')
+
+and now we can set up a predicate to test for presence of *Abnormal lens morphology*:
>>> from gpsea.analysis.predicate.phenotype import HpoPredicate
>>> query = hpotk.TermId.from_curie('HP:0000517')
@@ -41,4 +46,42 @@ missing_implies_phenotype_excluded
In many cases, published reports of clinical data about individuals with rare diseases describes phenotypic features that were observed, but do not
provide a comprehensive list of features that were explicitly excluded. By default, GPSEA will only include features that are recorded as observed or excluded in a phenopacket.
Setting this argument to True will cause "n/a" entries to be set to "excluded". We provide this option for exploration but do not recommend its use for the
-final analysis unless the assumption behind it is known to be true.
\ No newline at end of file
+final analysis unless the assumption behind it is known to be true.
+
+
+
+Predicates for all cohort phenotypes
+====================================
+
+Constructing phenotype predicates for all HPO terms of a cohort sounds a bit tedious.
+The :func:`~gpsea.analysis.predicate.phenotype.prepare_predicates_for_terms_of_interest`
+function cuts down the tedium.
+
+For a given phenopacket collection (e.g. 156 patients with mutations in *WWOX* gene included in Phenopacket Store version `0.1.18`)
+
+>>> from ppktstore.registry import configure_phenopacket_registry
+>>> registry = configure_phenopacket_registry()
+>>> with registry.open_phenopacket_store(release='0.1.18') as ps:
+... phenopackets = tuple(ps.iter_cohort_phenopackets('TBX5'))
+>>> len(phenopackets)
+156
+
+processed into a cohort
+
+>>> from gpsea.preprocessing import configure_caching_cohort_creator, load_phenopackets
+>>> cohort_creator = configure_caching_cohort_creator(hpo)
+>>> cohort, _ = load_phenopackets(phenopackets, cohort_creator) # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE
+Patients Created: ...
+
+
+we can create HPO predicates for testing all 260 HPO terms used in the cohort
+
+>>> from gpsea.analysis.predicate.phenotype import prepare_predicates_for_terms_of_interest
+>>> pheno_predicates = prepare_predicates_for_terms_of_interest(
+... cohort=cohort,
+... hpo=hpo,
+... )
+>>> len(pheno_predicates)
+260
+
+and subject the predicates into further analysis, such as :class:`~gpsea.analysis.pcats.HpoTermAnalysis`.
diff --git a/docs/user-guide/predicates/male_female_predicate.rst b/docs/user-guide/predicates/male_female_predicate.rst
index 8f16c96b2..3bed237ec 100644
--- a/docs/user-guide/predicates/male_female_predicate.rst
+++ b/docs/user-guide/predicates/male_female_predicate.rst
@@ -1,4 +1,4 @@
-.. _male_female_predicate:
+.. _male-female-predicate:
Partition by the sex of the individual
======================================
diff --git a/docs/user-guide/predicates/mode_of_inheritance_predicate.rst b/docs/user-guide/predicates/mode_of_inheritance_predicate.rst
index a00570d0d..2efb4d6be 100644
--- a/docs/user-guide/predicates/mode_of_inheritance_predicate.rst
+++ b/docs/user-guide/predicates/mode_of_inheritance_predicate.rst
@@ -1,4 +1,4 @@
-.. _mode_of_inheritance_predicate:
+.. _mode-of-inheritance-predicate:
==============================
Mode of Inheritance Predicates
@@ -92,6 +92,6 @@ for assigning a patient into a genotype group:
>>> from gpsea.analysis.predicate.genotype import ModeOfInheritancePredicate
>>> gt_predicate = ModeOfInheritancePredicate.autosomal_recessive(is_frameshift_or_stop_gain)
>>> gt_predicate.display_question()
-'What is the genotype group?: HOM_REF, HET, BIALLELIC_ALT'
+'What is the genotype group: HOM_REF, HET, BIALLELIC_ALT'
-The `gt_predicate` can be used in downstream analysis, such as in :class:
+The `gt_predicate` can be used in downstream analysis, such as in :class:`~gpsea.analysis.pcats.HpoTermAnalysis`.
diff --git a/docs/user-guide/report/tbx5_frameshift.csv b/docs/user-guide/report/tbx5_frameshift.csv
index 81b92d325..4851c198a 100644
--- a/docs/user-guide/report/tbx5_frameshift.csv
+++ b/docs/user-guide/report/tbx5_frameshift.csv
@@ -1,4 +1,4 @@
-"What is the genotype group?: HOM_REF, HET",HOM_REF,HOM_REF,HET,HET,,
+What is the genotype group,HOM_REF,HOM_REF,HET,HET,,
,Count,Percent,Count,Percent,Corrected p values,p values
Ventricular septal defect [HP:0001629],42/71,59%,19/19,100%,0.00411275392326226,0.00024192670136836825
Abnormal atrioventricular conduction [HP:0005150],1/23,4%,3/3,100%,0.01307692307692308,0.0015384615384615387
@@ -13,10 +13,10 @@ Muscular ventricular septal defect [HP:0011623],8/84,10%,6/25,24%,0.144002047919
Pulmonary arterial hypertension [HP:0002092],8/14,57%,0/2,0%,0.6899307928951143,0.4666666666666667
Short thumb [HP:0009778],25/69,36%,8/30,27%,0.6899307928951143,0.48700997145537483
Absent radius [HP:0003974],9/43,21%,6/25,24%,1.0,0.7703831604944444
-Atrial septal defect [HP:0001631],63/65,97%,20/20,100%,1.0,1.0
Hypoplasia of the radius [HP:0002984],34/75,45%,6/14,43%,1.0,1.0
Hypoplasia of the ulna [HP:0003022],3/17,18%,2/10,20%,1.0,1.0
Short humerus [HP:0005792],8/21,38%,4/9,44%,1.0,1.0
-Abnormal atrial septum morphology [HP:0011994],64/64,100%,20/20,100%,,
-Abnormal cardiac septum morphology [HP:0001671],89/89,100%,28/28,100%,,
-Abnormal heart morphology [HP:0001627],89/89,100%,30/30,100%,,
+Atrial septal defect [HP:0001631],63/65,97%,20/20,100%,1.0,1.0
+Aplasia/Hypoplasia of the thumb [HP:0009601],40/40,100%,19/19,100%,,
+Aplasia/Hypoplasia of fingers [HP:0006265],44/44,100%,19/19,100%,,
+Aplasia/hypoplasia involving bones of the hand [HP:0005927],44/44,100%,19/19,100%,,
diff --git a/docs/user-guide/report/tbx5_frameshift.mtc_report.html b/docs/user-guide/report/tbx5_frameshift.mtc_report.html
index fbc4a9de4..3d00300a0 100644
--- a/docs/user-guide/report/tbx5_frameshift.mtc_report.html
+++ b/docs/user-guide/report/tbx5_frameshift.mtc_report.html
@@ -103,14 +103,14 @@
Phenotype testing report
TODO
-
Skipping term with only 5 observations (not powered for 2x2)
+
Skipping term with maximum frequency that was less than threshold 0.2
10
TODO
-
Skipping term with maximum frequency that was less than threshold 0.2
+
Skipping term with only 5 observations (not powered for 2x2)
10
diff --git a/docs/user-guide/stats.rst b/docs/user-guide/stats.rst
index 4454e5964..59ad7604e 100644
--- a/docs/user-guide/stats.rst
+++ b/docs/user-guide/stats.rst
@@ -139,7 +139,7 @@ we expect the autosomal dominant mode of inheritance:
>>> from gpsea.analysis.predicate.genotype import ModeOfInheritancePredicate
>>> gt_predicate = ModeOfInheritancePredicate.autosomal_dominant(is_frameshift)
>>> gt_predicate.display_question()
-'What is the genotype group?: HOM_REF, HET'
+'What is the genotype group: HOM_REF, HET'
`gt_predicate` will assign the patients with no frameshift variant allele into `HOM_REF` group
and the patients with one frameshift allele will be assigned into `HET` group.
diff --git a/src/gpsea/analysis/predicate/genotype/_gt_predicates.py b/src/gpsea/analysis/predicate/genotype/_gt_predicates.py
index c4c82b5f9..76eebcc55 100644
--- a/src/gpsea/analysis/predicate/genotype/_gt_predicates.py
+++ b/src/gpsea/analysis/predicate/genotype/_gt_predicates.py
@@ -1,4 +1,3 @@
-from cProfile import label
import dataclasses
import enum
import typing
@@ -605,7 +604,7 @@ def __init__(
)
if issues:
raise ValueError("Cannot create predicate: {}".format(", ".join(issues)))
- self._question = "What is the genotype group?"
+ self._question = "What is the genotype group"
def get_categorizations(self) -> typing.Sequence[Categorization]:
return self._categorizations
@@ -727,7 +726,7 @@ def sex_predicate() -> GenotypePolyPredicate:
"""
Get a genotype predicate for categorizing patients by their :class:`~gpsea.model.Sex`.
- See the :ref:`sex-predicate` section for an example.
+ See the :ref:`male-female-predicate` section for an example.
"""
return INSTANCE
diff --git a/src/gpsea/analysis/predicate/phenotype/__init__.py b/src/gpsea/analysis/predicate/phenotype/__init__.py
index 2efa1e553..a70f954b9 100644
--- a/src/gpsea/analysis/predicate/phenotype/__init__.py
+++ b/src/gpsea/analysis/predicate/phenotype/__init__.py
@@ -6,13 +6,13 @@
or using the phenotype features encoded into HPO terms (:class:`PropagatingPhenotypePredicate`).
"""
-from ._pheno import PhenotypePolyPredicate, PropagatingPhenotypePredicate
+from ._pheno import PhenotypePolyPredicate, HpoPredicate
from ._pheno import DiseasePresencePredicate
from ._pheno import PhenotypeCategorization, P
from ._util import prepare_predicates_for_terms_of_interest, prepare_hpo_terms_of_interest
__all__ = [
- 'PhenotypePolyPredicate', 'PropagatingPhenotypePredicate',
+ 'PhenotypePolyPredicate', 'HpoPredicate',
'DiseasePresencePredicate',
'PhenotypeCategorization', 'P',
'prepare_predicates_for_terms_of_interest', 'prepare_hpo_terms_of_interest',
diff --git a/src/gpsea/analysis/predicate/phenotype/_pheno.py b/src/gpsea/analysis/predicate/phenotype/_pheno.py
index 3b2d9a7b4..4cb8a8041 100644
--- a/src/gpsea/analysis/predicate/phenotype/_pheno.py
+++ b/src/gpsea/analysis/predicate/phenotype/_pheno.py
@@ -92,13 +92,15 @@ def present_phenotype_category(self) -> PatientCategory:
return self.present_phenotype_categorization.category
-class PropagatingPhenotypePredicate(PhenotypePolyPredicate[hpotk.TermId]):
+class HpoPredicate(PhenotypePolyPredicate[hpotk.TermId]):
"""
- `PropagatingPhenotypePredicate` tests if a patient is annotated with an HPO term.
+ `HpoPredicate` tests if a patient is annotated with an HPO term.
Note, `query` must be a term of the provided `hpo`!
- :param hpo: HPO object
+ See :ref:`hpo-predicate` section for an example usage.
+
+ :param hpo: HPO ontology
:param query: the HPO term to test
:param missing_implies_phenotype_excluded: `True` if lack of an explicit annotation implies term's absence`.
"""
diff --git a/src/gpsea/analysis/predicate/phenotype/_util.py b/src/gpsea/analysis/predicate/phenotype/_util.py
index ac73dd02c..1a0e33d59 100644
--- a/src/gpsea/analysis/predicate/phenotype/_util.py
+++ b/src/gpsea/analysis/predicate/phenotype/_util.py
@@ -4,7 +4,7 @@
import hpotk
-from ._pheno import PhenotypePolyPredicate, PropagatingPhenotypePredicate
+from ._pheno import PhenotypePolyPredicate, HpoPredicate
from gpsea.model import Patient
@@ -26,7 +26,7 @@ def prepare_predicates_for_terms_of_interest(
(either directly or indirectly) for the term to be included in the analysis.
"""
return tuple(
- PropagatingPhenotypePredicate(
+ HpoPredicate(
hpo=hpo,
query=term,
missing_implies_phenotype_excluded=missing_implies_excluded,
diff --git a/tests/analysis/test_mtc_filter.py b/tests/analysis/test_mtc_filter.py
index d904cfe43..02710efdf 100644
--- a/tests/analysis/test_mtc_filter.py
+++ b/tests/analysis/test_mtc_filter.py
@@ -8,7 +8,7 @@
from gpsea.analysis.mtc_filter import HpoMtcFilter, SpecifiedTermsMtcFilter
from gpsea.analysis.predicate.genotype import GenotypePolyPredicate
-from gpsea.analysis.predicate.phenotype import PhenotypePolyPredicate, PropagatingPhenotypePredicate
+from gpsea.analysis.predicate.phenotype import PhenotypePolyPredicate, HpoPredicate
from gpsea.analysis.pcats import apply_predicates_on_patients
from gpsea.model import Cohort
@@ -55,7 +55,7 @@ def ph_predicate(
For the purpose of testing counts, let's pretend the counts
were created by this predicate.
"""
- return PropagatingPhenotypePredicate(
+ return HpoPredicate(
hpo=hpo,
query=hpotk.TermId.from_curie("HP:0001250"), # Seizure
missing_implies_phenotype_excluded=False,
diff --git a/tests/conftest.py b/tests/conftest.py
index b66b55e7d..266837245 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -6,7 +6,7 @@
import pytest
from gpsea.analysis.predicate.genotype import GenotypePolyPredicate, VariantPredicates, boolean_predicate
-from gpsea.analysis.predicate.phenotype import PhenotypePolyPredicate, PropagatingPhenotypePredicate
+from gpsea.analysis.predicate.phenotype import PhenotypePolyPredicate, HpoPredicate
from gpsea.io import GpseaJSONEncoder, GpseaJSONDecoder
from gpsea.model import *
from gpsea.model.genome import GRCh38, GenomicRegion, Region, Strand, GenomeBuild
@@ -128,23 +128,23 @@ def suox_pheno_predicates(
Note, these are just a *SUBSET* of all phenotypes that can be tested for in the *SUOX* cohort.
"""
return (
- PropagatingPhenotypePredicate(
+ HpoPredicate(
hpo=hpo,
query=hpotk.TermId.from_curie('HP:0001250'), # Seizure
),
- PropagatingPhenotypePredicate(
+ HpoPredicate(
hpo=hpo,
query=hpotk.TermId.from_curie('HP:0001083'), # Ectopia lentis
),
- PropagatingPhenotypePredicate(
+ HpoPredicate(
hpo=hpo,
query=hpotk.TermId.from_curie('HP:0032350'), # Sulfocysteinuria
),
- PropagatingPhenotypePredicate(
+ HpoPredicate(
hpo=hpo,
query=hpotk.TermId.from_curie('HP:0012758'), # Neurodevelopmental delay
),
- PropagatingPhenotypePredicate(
+ HpoPredicate(
hpo=hpo,
query=hpotk.TermId.from_curie('HP:0001276'), # Hypertonia
),
diff --git a/tests/test_predicates.py b/tests/test_predicates.py
index c87ce0adc..467a5df1b 100644
--- a/tests/test_predicates.py
+++ b/tests/test_predicates.py
@@ -2,7 +2,7 @@
import pytest
from gpsea.analysis.predicate import PatientCategory, PatientCategories
-from gpsea.analysis.predicate.phenotype import PropagatingPhenotypePredicate, DiseasePresencePredicate
+from gpsea.analysis.predicate.phenotype import HpoPredicate, DiseasePresencePredicate
from gpsea.analysis.predicate.genotype import *
from gpsea.model import Cohort, Patient, FeatureType, VariantEffect
from gpsea.model.genome import Region
@@ -16,7 +16,7 @@ def find_patient(pat_id: str, cohort: Cohort) -> Patient:
raise ValueError(f'Could not find patient {pat_id}')
-class TestPropagatingPhenotypeBooleanPredicate:
+class TestHpoPredicate:
@pytest.mark.parametrize('curie, patient_id, expected',
# Patient "HetSingleVar" has Phenotypes:
@@ -46,7 +46,7 @@ def test_phenotype_predicate__present_or_excluded(
):
patient = find_patient(patient_id, toy_cohort)
term_id = hpotk.TermId.from_curie(curie)
- predicate = PropagatingPhenotypePredicate(hpo=hpo, query=term_id)
+ predicate = HpoPredicate(hpo=hpo, query=term_id)
actual = predicate.test(patient)
assert actual.phenotype == term_id
@@ -60,7 +60,7 @@ def test_phenotype_predicate__unknown(
# Not Measured and not Observed - 'HP:0006280', # Chronic pancreatitis
patient = find_patient('HetSingleVar', toy_cohort)
term_id = hpotk.TermId.from_curie('HP:0006280')
- predicate = PropagatingPhenotypePredicate(hpo=hpo, query=term_id)
+ predicate = HpoPredicate(hpo=hpo, query=term_id)
actual = predicate.test(patient)
assert actual is None