Skip to content

Commit

Permalink
Merge pull request #264 from monarch-initiative/improve-moi-handling
Browse files Browse the repository at this point in the history
Improve mode of inheritance handling
  • Loading branch information
ielis authored Sep 11, 2024
2 parents 44cab77 + b0b157c commit 84d8a90
Show file tree
Hide file tree
Showing 14 changed files with 364 additions and 623 deletions.
4 changes: 2 additions & 2 deletions docs/report/tbx5_frameshift_vs_missense.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Genotype group,Missense,Missense,Frameshift,Frameshift,,
Allele 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.0008990549794102921,5.6190936213143254e-05
Abnormal atrioventricular conduction [HP:0005150],0/22,0%,3/3,100%,0.003478260869565217,0.00043478260869565214
Expand All @@ -12,7 +12,7 @@ Muscular ventricular septal defect [HP:0011623],6/59,10%,6/25,24%,0.299992259972
Pulmonary arterial hypertension [HP:0002092],4/6,67%,0/2,0%,0.6857142857142857,0.42857142857142855
Hypoplasia of the ulna [HP:0003022],1/12,8%,2/10,20%,0.831168831168831,0.5714285714285713
Hypoplasia of the radius [HP:0002984],30/62,48%,6/14,43%,1.0,0.7735491022101784
Atrial septal defect [HP:0001631],42/44,95%,20/20,100%,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
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
16 changes: 7 additions & 9 deletions docs/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -189,21 +189,19 @@ Prepare genotype and phenotype predicates
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

We will create a predicate to bin patients into group
depending on presence of a missense and frameshift variant to test
depending on presence of a single allele of a missense or frameshift variant to test
if there is a difference between frameshift and non-frameshift variants
in the individuals of the *TBX5* cohort.

>>> from gpsea.model import VariantEffect
>>> from gpsea.analysis.predicate.genotype import VariantPredicates, groups_predicate
>>> gt_predicate = groups_predicate(
... predicates=(
... VariantPredicates.variant_effect(VariantEffect.MISSENSE_VARIANT, tx_id),
... VariantPredicates.variant_effect(VariantEffect.FRAMESHIFT_VARIANT, tx_id)
... ),
... group_names=('Missense', 'Frameshift'),
>>> from gpsea.analysis.predicate.genotype import VariantPredicates, monoallelic_predicate
>>> gt_predicate = monoallelic_predicate(
... a_predicate=VariantPredicates.variant_effect(VariantEffect.MISSENSE_VARIANT, tx_id),
... b_predicate=VariantPredicates.variant_effect(VariantEffect.FRAMESHIFT_VARIANT, tx_id),
... names=('Missense', 'Frameshift')
... )
>>> gt_predicate.display_question()
'Genotype group: Missense, Frameshift'
'Allele group: Missense, Frameshift'

.. note::

Expand Down
56 changes: 0 additions & 56 deletions docs/user-guide/predicates/filtering_predicate.rst

This file was deleted.

1 change: 0 additions & 1 deletion docs/user-guide/predicates/genotype_predicates.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ the :class:`~gpsea.analysis.predicate.genotype.VariantPredicate` is all about.

variant_predicates
mode_of_inheritance_predicate
filtering_predicate
male_female_predicate
diagnosis_predicate
groups_predicate
Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/stats.rst
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ First, we create a :class:`~gpsea.analysis.predicate.genotype.VariantPredicate`
to test if the variant leads to a frameshift (in this case):

>>> from gpsea.model import VariantEffect
>>> from gpsea.analysis.predicate.genotype import VariantPredicates, boolean_predicate
>>> from gpsea.analysis.predicate.genotype import VariantPredicates
>>> tx_id = 'NM_181486.4'
>>> is_frameshift = VariantPredicates.variant_effect(VariantEffect.FRAMESHIFT_VARIANT, tx_id)
>>> is_frameshift.get_question()
Expand Down
6 changes: 4 additions & 2 deletions src/gpsea/analysis/predicate/genotype/__init__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
from ._api import GenotypePolyPredicate
from ._api import VariantPredicate
from ._counter import AlleleCounter
from ._gt_predicates import boolean_predicate, groups_predicate, filtering_predicate, sex_predicate, diagnosis_predicate
from ._gt_predicates import groups_predicate, sex_predicate, diagnosis_predicate
from ._gt_predicates import monoallelic_predicate, biallelic_predicate
from ._gt_predicates import ModeOfInheritancePredicate
from ._variant import VariantPredicates, ProteinPredicates

__all__ = [
'GenotypePolyPredicate',
'boolean_predicate', 'groups_predicate', 'filtering_predicate', 'sex_predicate', 'diagnosis_predicate',
'groups_predicate', 'sex_predicate', 'diagnosis_predicate',
'monoallelic_predicate', 'biallelic_predicate',
'ModeOfInheritancePredicate',
'AlleleCounter', 'VariantPredicate',
'VariantPredicates', 'ProteinPredicates',
Expand Down
Loading

0 comments on commit 84d8a90

Please sign in to comment.