Skip to content

Commit 216604d

Browse files
authored
Merge pull request #1086 from monarch-initiative/genotype-association-support
category enum and association display config to show genotype to variant and genotype to gene associations
2 parents 4e251d6 + b2533ad commit 216604d

File tree

9 files changed

+139
-118
lines changed

9 files changed

+139
-118
lines changed

backend/src/monarch_py/datamodels/category_enums.py

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ class EntityCategory(Enum):
55
"""Entity categories"""
66

77
GENE = "biolink:Gene"
8+
SEQUENCE_VARIANT = "biolink:SequenceVariant"
89
PHENOTYPIC_FEATURE = "biolink:PhenotypicFeature"
910
GENOTYPE = "biolink:Genotype"
1011
ANATOMICAL_ENTITY = "biolink:AnatomicalEntity"
1112
BIOLOGICAL_PROCESS = "biolink:BiologicalProcess"
1213
DISEASE = "biolink:Disease"
1314
NAMED_THING = "biolink:NamedThing"
14-
PATHWAY = "biolink:Pathway"
1515
PROTEIN = "biolink:Protein"
1616
CHEMICAL_ENTITY = "biolink:ChemicalEntity"
17-
SEQUENCE_VARIANT = "biolink:SequenceVariant"
17+
PATHWAY = "biolink:Pathway"
1818
MOLECULAR_ACTIVITY = "biolink:MolecularActivity"
1919
CELLULAR_COMPONENT = "biolink:CellularComponent"
2020
CELL = "biolink:Cell"
@@ -31,33 +31,35 @@ class AssociationCategory(Enum):
3131
MACROMOLECULAR_MACHINE_TO_BIOLOGICAL_PROCESS_ASSOCIATION = (
3232
"biolink:MacromolecularMachineToBiologicalProcessAssociation"
3333
)
34-
GENE_TO_PHENOTYPIC_FEATURE_ASSOCIATION = "biolink:GeneToPhenotypicFeatureAssociation"
35-
ASSOCIATION = "biolink:Association"
34+
GENE_TO_GENE_HOMOLOGY_ASSOCIATION = "biolink:GeneToGeneHomologyAssociation"
3635
MACROMOLECULAR_MACHINE_TO_MOLECULAR_ACTIVITY_ASSOCIATION = (
3736
"biolink:MacromolecularMachineToMolecularActivityAssociation"
3837
)
3938
MACROMOLECULAR_MACHINE_TO_CELLULAR_COMPONENT_ASSOCIATION = (
4039
"biolink:MacromolecularMachineToCellularComponentAssociation"
4140
)
42-
GENE_TO_GENE_HOMOLOGY_ASSOCIATION = "biolink:GeneToGeneHomologyAssociation"
41+
ASSOCIATION = "biolink:Association"
42+
GENE_TO_PHENOTYPIC_FEATURE_ASSOCIATION = "biolink:GeneToPhenotypicFeatureAssociation"
4343
GENOTYPE_TO_PHENOTYPIC_FEATURE_ASSOCIATION = "biolink:GenotypeToPhenotypicFeatureAssociation"
44+
VARIANT_TO_PHENOTYPIC_FEATURE_ASSOCIATION = "biolink:VariantToPhenotypicFeatureAssociation"
4445
DISEASE_TO_PHENOTYPIC_FEATURE_ASSOCIATION = "biolink:DiseaseToPhenotypicFeatureAssociation"
4546
GENE_TO_PATHWAY_ASSOCIATION = "biolink:GeneToPathwayAssociation"
46-
CHEMICAL_TO_PATHWAY_ASSOCIATION = "biolink:ChemicalToPathwayAssociation"
4747
VARIANT_TO_GENE_ASSOCIATION = "biolink:VariantToGeneAssociation"
48+
GENOTYPE_TO_VARIANT_ASSOCIATION = "biolink:GenotypeToVariantAssociation"
49+
GENOTYPE_TO_GENE_ASSOCIATION = "biolink:GenotypeToGeneAssociation"
50+
CHEMICAL_TO_PATHWAY_ASSOCIATION = "biolink:ChemicalToPathwayAssociation"
51+
CHEMICAL_TO_DISEASE_OR_PHENOTYPIC_FEATURE_ASSOCIATION = "biolink:ChemicalToDiseaseOrPhenotypicFeatureAssociation"
4852
VARIANT_TO_DISEASE_ASSOCIATION = "biolink:VariantToDiseaseAssociation"
4953
GENOTYPE_TO_DISEASE_ASSOCIATION = "biolink:GenotypeToDiseaseAssociation"
50-
CORRELATED_GENE_TO_DISEASE_ASSOCIATION = "biolink:CorrelatedGeneToDiseaseAssociation"
51-
CHEMICAL_TO_DISEASE_OR_PHENOTYPIC_FEATURE_ASSOCIATION = "biolink:ChemicalToDiseaseOrPhenotypicFeatureAssociation"
5254
DISEASE_OR_PHENOTYPIC_FEATURE_TO_GENETIC_INHERITANCE_ASSOCIATION = (
5355
"biolink:DiseaseOrPhenotypicFeatureToGeneticInheritanceAssociation"
5456
)
57+
CORRELATED_GENE_TO_DISEASE_ASSOCIATION = "biolink:CorrelatedGeneToDiseaseAssociation"
5558
CAUSAL_GENE_TO_DISEASE_ASSOCIATION = "biolink:CausalGeneToDiseaseAssociation"
5659
DISEASE_OR_PHENOTYPIC_FEATURE_TO_LOCATION_ASSOCIATION = "biolink:DiseaseOrPhenotypicFeatureToLocationAssociation"
5760
CHEMICAL_OR_DRUG_OR_TREATMENT_TO_DISEASE_OR_PHENOTYPIC_FEATURE_ASSOCIATION = (
5861
"biolink:ChemicalOrDrugOrTreatmentToDiseaseOrPhenotypicFeatureAssociation"
5962
)
60-
VARIANT_TO_PHENOTYPIC_FEATURE_ASSOCIATION = "biolink:VariantToPhenotypicFeatureAssociation"
6163

6264

6365
class AssociationPredicate(Enum):
@@ -66,34 +68,38 @@ class AssociationPredicate(Enum):
6668
INTERACTS_WITH = "biolink:interacts_with"
6769
EXPRESSED_IN = "biolink:expressed_in"
6870
HAS_PHENOTYPE = "biolink:has_phenotype"
71+
ORTHOLOGOUS_TO = "biolink:orthologous_to"
6972
ENABLES = "biolink:enables"
7073
ACTIVELY_INVOLVED_IN = "biolink:actively_involved_in"
71-
ORTHOLOGOUS_TO = "biolink:orthologous_to"
72-
SUBCLASS_OF = "biolink:subclass_of"
7374
LOCATED_IN = "biolink:located_in"
75+
SUBCLASS_OF = "biolink:subclass_of"
7476
RELATED_TO = "biolink:related_to"
7577
PARTICIPATES_IN = "biolink:participates_in"
7678
ACTS_UPSTREAM_OF_OR_WITHIN = "biolink:acts_upstream_of_or_within"
7779
IS_ACTIVE_IN = "biolink:is_active_in"
80+
IS_SEQUENCE_VARIANT_OF = "biolink:is_sequence_variant_of"
81+
HAS_SEQUENCE_VARIANT = "biolink:has_sequence_variant"
7882
PART_OF = "biolink:part_of"
83+
TREATS_OR_APPLIED_OR_STUDIED_TO_TREAT = "biolink:treats_or_applied_or_studied_to_treat"
7984
CAUSES = "biolink:causes"
80-
IS_SEQUENCE_VARIANT_OF = "biolink:is_sequence_variant_of"
81-
MODEL_OF = "biolink:model_of"
8285
ACTS_UPSTREAM_OF = "biolink:acts_upstream_of"
83-
TREATS_OR_APPLIED_OR_STUDIED_TO_TREAT = "biolink:treats_or_applied_or_studied_to_treat"
86+
MODEL_OF = "biolink:model_of"
87+
CONTRIBUTES_TO = "biolink:contributes_to"
8488
HAS_MODE_OF_INHERITANCE = "biolink:has_mode_of_inheritance"
8589
GENE_ASSOCIATED_WITH_CONDITION = "biolink:gene_associated_with_condition"
86-
CONTRIBUTES_TO = "biolink:contributes_to"
8790
ASSOCIATED_WITH_INCREASED_LIKELIHOOD_OF = "biolink:associated_with_increased_likelihood_of"
8891
COLOCALIZES_WITH = "biolink:colocalizes_with"
8992
GENETICALLY_ASSOCIATED_WITH = "biolink:genetically_associated_with"
9093
DISEASE_HAS_LOCATION = "biolink:disease_has_location"
9194
ACTS_UPSTREAM_OF_POSITIVE_EFFECT = "biolink:acts_upstream_of_positive_effect"
92-
ACTS_UPSTREAM_OF_OR_WITHIN_POSITIVE_EFFECT = "biolink:acts_upstream_of_or_within_positive_effect"
9395
AMELIORATES_CONDITION = "biolink:ameliorates_condition"
96+
ACTS_UPSTREAM_OF_OR_WITHIN_POSITIVE_EFFECT = "biolink:acts_upstream_of_or_within_positive_effect"
9497
ACTS_UPSTREAM_OF_NEGATIVE_EFFECT = "biolink:acts_upstream_of_negative_effect"
98+
HAS_PARTICIPANT = "biolink:has_participant"
9599
ACTS_UPSTREAM_OF_OR_WITHIN_NEGATIVE_EFFECT = "biolink:acts_upstream_of_or_within_negative_effect"
96100
PREVENTATIVE_FOR_CONDITION = "biolink:preventative_for_condition"
101+
DISRUPTS = "biolink:disrupts"
102+
CAUSED_BY = "biolink:caused_by"
97103
CONTRAINDICATED_IN = "biolink:contraindicated_in"
98104

99105

backend/src/monarch_py/utils/association_type_mappings.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,9 @@
5454
- subject_label: Variant to Phenotype
5555
object_label: Variant to Phenotype
5656
category: "biolink:VariantToPhenotypicFeatureAssociation"
57+
- subject_label: Genotype to Gene
58+
object_label: Genotype to Gene
59+
category: "biolink:GenotypeToGeneAssociation"
60+
- subject_label: Genotype to Variant
61+
object_label: Genotype to Variant
62+
category: "biolink:GenotypeToVariantAssociation"

backend/tests/fixtures/association_counts_query.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ def association_counts_query():
2929
'(category:"biolink:GenotypeToDiseaseAssociation") AND (subject:"MONDO:0020121" OR subject_closure:"MONDO:0020121")',
3030
'(category:"biolink:ChemicalOrDrugOrTreatmentToDiseaseOrPhenotypicFeatureAssociation") AND (subject:"MONDO:0020121" OR subject_closure:"MONDO:0020121")',
3131
'(category:"biolink:VariantToPhenotypicFeatureAssociation") AND (subject:"MONDO:0020121" OR subject_closure:"MONDO:0020121")',
32+
'(category:"biolink:GenotypeToGeneAssociation") AND (subject:"MONDO:0020121" OR subject_closure:"MONDO:0020121")',
33+
'(category:"biolink:GenotypeToVariantAssociation") AND (subject:"MONDO:0020121" OR subject_closure:"MONDO:0020121")',
3234
'(category:"biolink:DiseaseToPhenotypicFeatureAssociation") AND (object:"MONDO:0020121" OR object_closure:"MONDO:0020121" OR disease_context_qualifier:"MONDO:0020121" OR disease_context_qualifier_closure:"MONDO:0020121")',
3335
'(category:"biolink:GeneToPhenotypicFeatureAssociation") AND (object:"MONDO:0020121" OR object_closure:"MONDO:0020121" OR disease_context_qualifier:"MONDO:0020121" OR disease_context_qualifier_closure:"MONDO:0020121")',
3436
'(category:"biolink:PairwiseGeneToGeneInteraction") AND (object:"MONDO:0020121" OR object_closure:"MONDO:0020121" OR disease_context_qualifier:"MONDO:0020121" OR disease_context_qualifier_closure:"MONDO:0020121")',
@@ -47,6 +49,8 @@ def association_counts_query():
4749
'(category:"biolink:GenotypeToDiseaseAssociation") AND (object:"MONDO:0020121" OR object_closure:"MONDO:0020121" OR disease_context_qualifier:"MONDO:0020121" OR disease_context_qualifier_closure:"MONDO:0020121")',
4850
'(category:"biolink:ChemicalOrDrugOrTreatmentToDiseaseOrPhenotypicFeatureAssociation") AND (object:"MONDO:0020121" OR object_closure:"MONDO:0020121" OR disease_context_qualifier:"MONDO:0020121" OR disease_context_qualifier_closure:"MONDO:0020121")',
4951
'(category:"biolink:VariantToPhenotypicFeatureAssociation") AND (object:"MONDO:0020121" OR object_closure:"MONDO:0020121" OR disease_context_qualifier:"MONDO:0020121" OR disease_context_qualifier_closure:"MONDO:0020121")',
52+
'(category:"biolink:GenotypeToGeneAssociation") AND (object:"MONDO:0020121" OR object_closure:"MONDO:0020121" OR disease_context_qualifier:"MONDO:0020121" OR disease_context_qualifier_closure:"MONDO:0020121")',
53+
'(category:"biolink:GenotypeToVariantAssociation") AND (object:"MONDO:0020121" OR object_closure:"MONDO:0020121" OR disease_context_qualifier:"MONDO:0020121" OR disease_context_qualifier_closure:"MONDO:0020121")',
5054
],
5155
"filter_queries": [
5256
'subject:"MONDO:0020121" OR subject_closure:"MONDO:0020121" OR object:"MONDO:0020121" OR object_closure:"MONDO:0020121" OR disease_context_qualifier:"MONDO:0020121" OR disease_context_qualifier_closure:"MONDO:0020121"'

backend/tests/fixtures/association_counts_response.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
def association_counts_response():
66
return {
77
"responseHeader": {
8-
"QTime": 2,
8+
"QTime": 1,
99
"params": {
1010
"facet.query": [
1111
'(category:"biolink:DiseaseToPhenotypicFeatureAssociation") AND (subject:"MONDO:0020121" OR subject_closure:"MONDO:0020121")',
@@ -26,6 +26,8 @@ def association_counts_response():
2626
'(category:"biolink:GenotypeToDiseaseAssociation") AND (subject:"MONDO:0020121" OR subject_closure:"MONDO:0020121")',
2727
'(category:"biolink:ChemicalOrDrugOrTreatmentToDiseaseOrPhenotypicFeatureAssociation") AND (subject:"MONDO:0020121" OR subject_closure:"MONDO:0020121")',
2828
'(category:"biolink:VariantToPhenotypicFeatureAssociation") AND (subject:"MONDO:0020121" OR subject_closure:"MONDO:0020121")',
29+
'(category:"biolink:GenotypeToGeneAssociation") AND (subject:"MONDO:0020121" OR subject_closure:"MONDO:0020121")',
30+
'(category:"biolink:GenotypeToVariantAssociation") AND (subject:"MONDO:0020121" OR subject_closure:"MONDO:0020121")',
2931
'(category:"biolink:DiseaseToPhenotypicFeatureAssociation") AND (object:"MONDO:0020121" OR object_closure:"MONDO:0020121" OR disease_context_qualifier:"MONDO:0020121" OR disease_context_qualifier_closure:"MONDO:0020121")',
3032
'(category:"biolink:GeneToPhenotypicFeatureAssociation") AND (object:"MONDO:0020121" OR object_closure:"MONDO:0020121" OR disease_context_qualifier:"MONDO:0020121" OR disease_context_qualifier_closure:"MONDO:0020121")',
3133
'(category:"biolink:PairwiseGeneToGeneInteraction") AND (object:"MONDO:0020121" OR object_closure:"MONDO:0020121" OR disease_context_qualifier:"MONDO:0020121" OR disease_context_qualifier_closure:"MONDO:0020121")',
@@ -44,6 +46,8 @@ def association_counts_response():
4446
'(category:"biolink:GenotypeToDiseaseAssociation") AND (object:"MONDO:0020121" OR object_closure:"MONDO:0020121" OR disease_context_qualifier:"MONDO:0020121" OR disease_context_qualifier_closure:"MONDO:0020121")',
4547
'(category:"biolink:ChemicalOrDrugOrTreatmentToDiseaseOrPhenotypicFeatureAssociation") AND (object:"MONDO:0020121" OR object_closure:"MONDO:0020121" OR disease_context_qualifier:"MONDO:0020121" OR disease_context_qualifier_closure:"MONDO:0020121")',
4648
'(category:"biolink:VariantToPhenotypicFeatureAssociation") AND (object:"MONDO:0020121" OR object_closure:"MONDO:0020121" OR disease_context_qualifier:"MONDO:0020121" OR disease_context_qualifier_closure:"MONDO:0020121")',
49+
'(category:"biolink:GenotypeToGeneAssociation") AND (object:"MONDO:0020121" OR object_closure:"MONDO:0020121" OR disease_context_qualifier:"MONDO:0020121" OR disease_context_qualifier_closure:"MONDO:0020121")',
50+
'(category:"biolink:GenotypeToVariantAssociation") AND (object:"MONDO:0020121" OR object_closure:"MONDO:0020121" OR disease_context_qualifier:"MONDO:0020121" OR disease_context_qualifier_closure:"MONDO:0020121")',
4751
],
4852
"mm": "100%",
4953
"q": "*:*",
@@ -5827,6 +5831,8 @@ def association_counts_response():
58275831
'(category:"biolink:GenotypeToDiseaseAssociation") AND (subject:"MONDO:0020121" OR subject_closure:"MONDO:0020121")': 0,
58285832
'(category:"biolink:ChemicalOrDrugOrTreatmentToDiseaseOrPhenotypicFeatureAssociation") AND (subject:"MONDO:0020121" OR subject_closure:"MONDO:0020121")': 0,
58295833
'(category:"biolink:VariantToPhenotypicFeatureAssociation") AND (subject:"MONDO:0020121" OR subject_closure:"MONDO:0020121")': 0,
5834+
'(category:"biolink:GenotypeToGeneAssociation") AND (subject:"MONDO:0020121" OR subject_closure:"MONDO:0020121")': 0,
5835+
'(category:"biolink:GenotypeToVariantAssociation") AND (subject:"MONDO:0020121" OR subject_closure:"MONDO:0020121")': 0,
58305836
'(category:"biolink:DiseaseToPhenotypicFeatureAssociation") AND (object:"MONDO:0020121" OR object_closure:"MONDO:0020121" OR disease_context_qualifier:"MONDO:0020121" OR disease_context_qualifier_closure:"MONDO:0020121")': 0,
58315837
'(category:"biolink:GeneToPhenotypicFeatureAssociation") AND (object:"MONDO:0020121" OR object_closure:"MONDO:0020121" OR disease_context_qualifier:"MONDO:0020121" OR disease_context_qualifier_closure:"MONDO:0020121")': 6475,
58325838
'(category:"biolink:PairwiseGeneToGeneInteraction") AND (object:"MONDO:0020121" OR object_closure:"MONDO:0020121" OR disease_context_qualifier:"MONDO:0020121" OR disease_context_qualifier_closure:"MONDO:0020121")': 0,
@@ -5845,6 +5851,8 @@ def association_counts_response():
58455851
'(category:"biolink:GenotypeToDiseaseAssociation") AND (object:"MONDO:0020121" OR object_closure:"MONDO:0020121" OR disease_context_qualifier:"MONDO:0020121" OR disease_context_qualifier_closure:"MONDO:0020121")': 242,
58465852
'(category:"biolink:ChemicalOrDrugOrTreatmentToDiseaseOrPhenotypicFeatureAssociation") AND (object:"MONDO:0020121" OR object_closure:"MONDO:0020121" OR disease_context_qualifier:"MONDO:0020121" OR disease_context_qualifier_closure:"MONDO:0020121")': 4,
58475853
'(category:"biolink:VariantToPhenotypicFeatureAssociation") AND (object:"MONDO:0020121" OR object_closure:"MONDO:0020121" OR disease_context_qualifier:"MONDO:0020121" OR disease_context_qualifier_closure:"MONDO:0020121")': 0,
5854+
'(category:"biolink:GenotypeToGeneAssociation") AND (object:"MONDO:0020121" OR object_closure:"MONDO:0020121" OR disease_context_qualifier:"MONDO:0020121" OR disease_context_qualifier_closure:"MONDO:0020121")': 0,
5855+
'(category:"biolink:GenotypeToVariantAssociation") AND (object:"MONDO:0020121" OR object_closure:"MONDO:0020121" OR disease_context_qualifier:"MONDO:0020121" OR disease_context_qualifier_closure:"MONDO:0020121")': 0,
58485856
},
58495857
},
58505858
"highlighting": {},

backend/tests/fixtures/association_table_response.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
def association_table_response():
66
return {
77
"responseHeader": {
8-
"QTime": 1,
8+
"QTime": 0,
99
"params": {
1010
"mm": "100%",
1111
"q": "*:*",

backend/tests/fixtures/autocomplete_response.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
def autocomplete_response():
66
return {
77
"responseHeader": {
8-
"QTime": 1,
8+
"QTime": 0,
99
"params": {
1010
"mm": "100%",
1111
"q": "fanc",

frontend/fixtures/phenotype-explorer-compare.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"subject_termset": {
3-
"MP:0002169": {
4-
"id": "MP:0002169",
5-
"label": "no abnormal phenotype detected"
6-
},
73
"MP:0010771": {
84
"id": "MP:0010771",
95
"label": "integument phenotype"
6+
},
7+
"MP:0002169": {
8+
"id": "MP:0002169",
9+
"label": "no abnormal phenotype detected"
1010
}
1111
},
1212
"object_termset": {

0 commit comments

Comments
 (0)