Skip to content

Commit

Permalink
Add medical action association table to UI (plus fixture & enum regen) (
Browse files Browse the repository at this point in the history
#937)

Adds a medical action table showing the MaXO term, predicate, phenotype
and disease. For simplicity sake, the section is labeled as "Medical
Action" on both MaXO pages and phenotype pages.

Creating as a draft, because I realized that it needs to show up on
disease pages as well, which means that the API request will need to
change so that when "entity=<ID of page>" comes into the api request,
disease_context_qualifier is searched, and I think we'll also want to
make sure we're searching disease_context_qualifier_closure as well
(which is hopefully already getting generated!

Closes #919 
Closes #935
  • Loading branch information
kevinschaper authored Jan 17, 2025
1 parent da511ba commit f772fea
Show file tree
Hide file tree
Showing 46 changed files with 114,577 additions and 107,949 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/test-backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
pull_request:
workflow_dispatch:

env:
PYTHONPATH: ${{ github.workspace }}/backend

# defaults:
# run:
# working-directory: ./backend
Expand Down Expand Up @@ -40,14 +43,16 @@ jobs:
# run pytest
#----------------------------------------------
- name: Run tests
run: poetry -C backend run pytest backend/tests
run: |
poetry -C backend run pytest tests
shell: bash

#----------------------------------------------
# coverage report
#----------------------------------------------
- name: Generate coverage results
run: |
poetry -C backend run coverage run -m pytest backend/tests
poetry -C backend run coverage run -m pytest tests
poetry -C backend run coverage xml
poetry -C backend run coverage report -m
shell: bash
Expand Down
116 changes: 32 additions & 84 deletions backend/src/monarch_py/datamodels/category_enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,119 +4,60 @@
class EntityCategory(Enum):
"""Entity categories"""

SEQUENCE_VARIANT = "biolink:SequenceVariant"
GENE = "biolink:Gene"
GENOTYPE = "biolink:Genotype"
PHENOTYPIC_FEATURE = "biolink:PhenotypicFeature"
BIOLOGICAL_PROCESS_OR_ACTIVITY = "biolink:BiologicalProcessOrActivity"
DISEASE = "biolink:Disease"
GROSS_ANATOMICAL_STRUCTURE = "biolink:GrossAnatomicalStructure"
CELL = "biolink:Cell"
PATHWAY = "biolink:Pathway"
NAMED_THING = "biolink:NamedThing"
GENOTYPE = "biolink:Genotype"
ANATOMICAL_ENTITY = "biolink:AnatomicalEntity"
CELLULAR_COMPONENT = "biolink:CellularComponent"
MOLECULAR_ENTITY = "biolink:MolecularEntity"
BIOLOGICAL_PROCESS = "biolink:BiologicalProcess"
MACROMOLECULAR_COMPLEX = "biolink:MacromolecularComplex"
MOLECULAR_ACTIVITY = "biolink:MolecularActivity"
DISEASE = "biolink:Disease"
NAMED_THING = "biolink:NamedThing"
PATHWAY = "biolink:Pathway"
PROTEIN = "biolink:Protein"
CELLULAR_ORGANISM = "biolink:CellularOrganism"
VERTEBRATE = "biolink:Vertebrate"
VIRUS = "biolink:Virus"
BEHAVIORAL_FEATURE = "biolink:BehavioralFeature"
CHEMICAL_ENTITY = "biolink:ChemicalEntity"
LIFE_STAGE = "biolink:LifeStage"
PATHOLOGICAL_PROCESS = "biolink:PathologicalProcess"
DRUG = "biolink:Drug"
SMALL_MOLECULE = "biolink:SmallMolecule"
SEQUENCE_VARIANT = "biolink:SequenceVariant"
MOLECULAR_ACTIVITY = "biolink:MolecularActivity"
CELLULAR_COMPONENT = "biolink:CellularComponent"
CELL = "biolink:Cell"
ORGANISM_TAXON = "biolink:OrganismTaxon"
INFORMATION_CONTENT_ENTITY = "biolink:InformationContentEntity"
NUCLEIC_ACID_ENTITY = "biolink:NucleicAcidEntity"
EVIDENCE_TYPE = "biolink:EvidenceType"
RNAPRODUCT = "biolink:RNAProduct"
TRANSCRIPT = "biolink:Transcript"
FUNGUS = "biolink:Fungus"
PLANT = "biolink:Plant"
PROCESSED_MATERIAL = "biolink:ProcessedMaterial"
ACTIVITY = "biolink:Activity"
AGENT = "biolink:Agent"
CONFIDENCE_LEVEL = "biolink:ConfidenceLevel"
DATASET = "biolink:Dataset"
ENVIRONMENTAL_FEATURE = "biolink:EnvironmentalFeature"
GENETIC_INHERITANCE = "biolink:GeneticInheritance"
HAPLOTYPE = "biolink:Haplotype"
INVERTEBRATE = "biolink:Invertebrate"
MAMMAL = "biolink:Mammal"
POPULATION_OF_INDIVIDUAL_ORGANISMS = "biolink:PopulationOfIndividualOrganisms"
PROTEIN_FAMILY = "biolink:ProteinFamily"
PUBLICATION = "biolink:Publication"
ACCESSIBLE_DNA_REGION = "biolink:AccessibleDnaRegion"
BACTERIUM = "biolink:Bacterium"
BIOLOGICAL_SEX = "biolink:BiologicalSex"
CELL_LINE = "biolink:CellLine"
CHEMICAL_EXPOSURE = "biolink:ChemicalExposure"
CHEMICAL_MIXTURE = "biolink:ChemicalMixture"
DATASET_DISTRIBUTION = "biolink:DatasetDistribution"
DIAGNOSTIC_AID = "biolink:DiagnosticAid"
DRUG_EXPOSURE = "biolink:DrugExposure"
ENVIRONMENTAL_PROCESS = "biolink:EnvironmentalProcess"
EVENT = "biolink:Event"
EXON = "biolink:Exon"
GENOME = "biolink:Genome"
GENOTYPIC_SEX = "biolink:GenotypicSex"
HUMAN = "biolink:Human"
INDIVIDUAL_ORGANISM = "biolink:IndividualOrganism"
MATERIAL_SAMPLE = "biolink:MaterialSample"
MICRO_RNA = "biolink:MicroRNA"
ORGANISMAL_ENTITY = "biolink:OrganismalEntity"
PATENT = "biolink:Patent"
PHENOTYPIC_SEX = "biolink:PhenotypicSex"
POLYPEPTIDE = "biolink:Polypeptide"
PROTEIN_DOMAIN = "biolink:ProteinDomain"
REAGENT_TARGETED_GENE = "biolink:ReagentTargetedGene"
REGULATORY_REGION = "biolink:RegulatoryRegion"
SI_RNA = "biolink:SiRNA"
SNV = "biolink:Snv"
STUDY = "biolink:Study"
STUDY_VARIABLE = "biolink:StudyVariable"
TRANSCRIPTION_FACTOR_BINDING_SITE = "biolink:TranscriptionFactorBindingSite"
TREATMENT = "biolink:Treatment"
WEB_PAGE = "biolink:WebPage"
ZYGOSITY = "biolink:Zygosity"
MOLECULAR_ENTITY = "biolink:MolecularEntity"
LIFE_STAGE = "biolink:LifeStage"


class AssociationCategory(Enum):
"""Association categories"""

PAIRWISE_GENE_TO_GENE_INTERACTION = "biolink:PairwiseGeneToGeneInteraction"
GENE_TO_EXPRESSION_SITE_ASSOCIATION = "biolink:GeneToExpressionSiteAssociation"
VARIANT_TO_GENE_ASSOCIATION = "biolink:VariantToGeneAssociation"
MACROMOLECULAR_MACHINE_TO_BIOLOGICAL_PROCESS_ASSOCIATION = (
"biolink:MacromolecularMachineToBiologicalProcessAssociation"
)
GENE_TO_PHENOTYPIC_FEATURE_ASSOCIATION = "biolink:GeneToPhenotypicFeatureAssociation"
ASSOCIATION = "biolink:Association"
MACROMOLECULAR_MACHINE_TO_MOLECULAR_ACTIVITY_ASSOCIATION = (
"biolink:MacromolecularMachineToMolecularActivityAssociation"
)
MACROMOLECULAR_MACHINE_TO_CELLULAR_COMPONENT_ASSOCIATION = (
"biolink:MacromolecularMachineToCellularComponentAssociation"
)
ASSOCIATION = "biolink:Association"
GENE_TO_GENE_HOMOLOGY_ASSOCIATION = "biolink:GeneToGeneHomologyAssociation"
GENOTYPE_TO_PHENOTYPIC_FEATURE_ASSOCIATION = "biolink:GenotypeToPhenotypicFeatureAssociation"
DISEASE_TO_PHENOTYPIC_FEATURE_ASSOCIATION = "biolink:DiseaseToPhenotypicFeatureAssociation"
GENE_TO_PATHWAY_ASSOCIATION = "biolink:GeneToPathwayAssociation"
DISEASE_OR_PHENOTYPIC_FEATURE_TO_LOCATION_ASSOCIATION = "biolink:DiseaseOrPhenotypicFeatureToLocationAssociation"
CHEMICAL_TO_PATHWAY_ASSOCIATION = "biolink:ChemicalToPathwayAssociation"
VARIANT_TO_GENE_ASSOCIATION = "biolink:VariantToGeneAssociation"
VARIANT_TO_DISEASE_ASSOCIATION = "biolink:VariantToDiseaseAssociation"
GENOTYPE_TO_DISEASE_ASSOCIATION = "biolink:GenotypeToDiseaseAssociation"
CORRELATED_GENE_TO_DISEASE_ASSOCIATION = "biolink:CorrelatedGeneToDiseaseAssociation"
CHEMICAL_TO_DISEASE_OR_PHENOTYPIC_FEATURE_ASSOCIATION = "biolink:ChemicalToDiseaseOrPhenotypicFeatureAssociation"
DISEASE_OR_PHENOTYPIC_FEATURE_TO_GENETIC_INHERITANCE_ASSOCIATION = (
"biolink:DiseaseOrPhenotypicFeatureToGeneticInheritanceAssociation"
)
VARIANT_TO_DISEASE_ASSOCIATION = "biolink:VariantToDiseaseAssociation"
CAUSAL_GENE_TO_DISEASE_ASSOCIATION = "biolink:CausalGeneToDiseaseAssociation"
CHEMICAL_TO_DISEASE_OR_PHENOTYPIC_FEATURE_ASSOCIATION = "biolink:ChemicalToDiseaseOrPhenotypicFeatureAssociation"
DISEASE_OR_PHENOTYPIC_FEATURE_TO_LOCATION_ASSOCIATION = "biolink:DiseaseOrPhenotypicFeatureToLocationAssociation"
CHEMICAL_OR_DRUG_OR_TREATMENT_TO_DISEASE_OR_PHENOTYPIC_FEATURE_ASSOCIATION = (
"biolink:ChemicalOrDrugOrTreatmentToDiseaseOrPhenotypicFeatureAssociation"
)
VARIANT_TO_PHENOTYPIC_FEATURE_ASSOCIATION = "biolink:VariantToPhenotypicFeatureAssociation"


class AssociationPredicate(Enum):
Expand All @@ -125,33 +66,40 @@ class AssociationPredicate(Enum):
INTERACTS_WITH = "biolink:interacts_with"
EXPRESSED_IN = "biolink:expressed_in"
HAS_PHENOTYPE = "biolink:has_phenotype"
IS_SEQUENCE_VARIANT_OF = "biolink:is_sequence_variant_of"
ENABLES = "biolink:enables"
ACTIVELY_INVOLVED_IN = "biolink:actively_involved_in"
ORTHOLOGOUS_TO = "biolink:orthologous_to"
LOCATED_IN = "biolink:located_in"
SUBCLASS_OF = "biolink:subclass_of"
LOCATED_IN = "biolink:located_in"
RELATED_TO = "biolink:related_to"
PARTICIPATES_IN = "biolink:participates_in"
ACTS_UPSTREAM_OF_OR_WITHIN = "biolink:acts_upstream_of_or_within"
ACTIVE_IN = "biolink:active_in"
IS_ACTIVE_IN = "biolink:is_active_in"
PART_OF = "biolink:part_of"
MODEL_OF = "biolink:model_of"
CAUSES = "biolink:causes"
IS_SEQUENCE_VARIANT_OF = "biolink:is_sequence_variant_of"
MODEL_OF = "biolink:model_of"
ACTS_UPSTREAM_OF = "biolink:acts_upstream_of"
TREATS_OR_APPLIED_OR_STUDIED_TO_TREAT = "biolink:treats_or_applied_or_studied_to_treat"
HAS_MODE_OF_INHERITANCE = "biolink:has_mode_of_inheritance"
CONTRIBUTES_TO = "biolink:contributes_to"
GENE_ASSOCIATED_WITH_CONDITION = "biolink:gene_associated_with_condition"
TREATS_OR_APPLIED_OR_STUDIED_TO_TREAT = "biolink:treats_or_applied_or_studied_to_treat"
CONTRIBUTES_TO = "biolink:contributes_to"
ASSOCIATED_WITH_INCREASED_LIKELIHOOD_OF = "biolink:associated_with_increased_likelihood_of"
COLOCALIZES_WITH = "biolink:colocalizes_with"
GENETICALLY_ASSOCIATED_WITH = "biolink:genetically_associated_with"
DISEASE_HAS_LOCATION = "biolink:disease_has_location"
ACTS_UPSTREAM_OF_POSITIVE_EFFECT = "biolink:acts_upstream_of_positive_effect"
ACTS_UPSTREAM_OF_OR_WITHIN_POSITIVE_EFFECT = "biolink:acts_upstream_of_or_within_positive_effect"
AMELIORATES_CONDITION = "biolink:ameliorates_condition"
ACTS_UPSTREAM_OF_NEGATIVE_EFFECT = "biolink:acts_upstream_of_negative_effect"
ACTS_UPSTREAM_OF_OR_WITHIN_NEGATIVE_EFFECT = "biolink:acts_upstream_of_or_within_negative_effect"
PREVENTATIVE_FOR_CONDITION = "biolink:preventative_for_condition"
CONTRAINDICATED_IN = "biolink:contraindicated_in"


class MappingPredicate(Enum):
"""Mapping predicates"""

EXACT_MATCH = "skos:exactMatch"
CLOSE_MATCH = "skos:closeMatch"
BROAD_MATCH = "skos:broadMatch"
Loading

0 comments on commit f772fea

Please sign in to comment.