Skip to content

Commit

Permalink
Fixtures and formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinschaper committed Oct 21, 2023
1 parent 1d1b2e1 commit 6b0128b
Show file tree
Hide file tree
Showing 22 changed files with 6,168 additions and 12,125 deletions.
3 changes: 2 additions & 1 deletion backend/src/monarch_py/api/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from fastapi.middleware.cors import CORSMiddleware
from fastapi.responses import RedirectResponse
from monarch_py.api import association, entity, histopheno, search, semsim
from monarch_py.api.config import oak, solr
from monarch_py.api.config import oak
from monarch_py.api.middleware.logging_middleware import LoggingMiddleware
from monarch_py.service.curie_service import CurieService

Expand Down Expand Up @@ -38,6 +38,7 @@ async def initialize_app():
)
app.add_middleware(LoggingMiddleware)


@app.get("/")
async def _root():
return RedirectResponse(url="/v3/docs")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ async def dispatch(self, request: Request, call_next):
# request._body = body

response = await call_next(request)
return response
return response
4 changes: 1 addition & 3 deletions backend/src/monarch_py/api/semsim.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
from typing import List

from fastapi import APIRouter, Path, Query
from fastapi import APIRouter, Path

from monarch_py.api.additional_models import CompareRequest
from monarch_py.api.config import oak
Expand Down
176 changes: 44 additions & 132 deletions backend/src/monarch_py/datamodels/model.py

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions backend/tests/fixtures/association_counts_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ def association_counts_query():
'(category:"biolink:GeneToGeneHomologyAssociation") AND (subject:"MONDO:0020121" OR subject_closure:"MONDO:0020121")',
'(category:"biolink:ChemicalToPathwayAssociation") AND (subject:"MONDO:0020121" OR subject_closure:"MONDO:0020121")',
'(category:"biolink:MacromolecularMachineToMolecularActivityAssociation") AND (subject:"MONDO:0020121" OR subject_closure:"MONDO:0020121")',
'(category:"biolink:MacromolecularMachineToCellularComponentAssociation") AND (subject:"MONDO:0020121" OR subject_closure:"MONDO:0020121")',
'(category:"biolink:MacromolecularMachineToBiologicalProcessAssociation") AND (subject:"MONDO:0020121" OR subject_closure:"MONDO:0020121")',
'(category:"biolink:CausalGeneToDiseaseAssociation") AND (subject:"MONDO:0020121" OR subject_closure:"MONDO:0020121")',
'(category:"biolink:CorrelatedGeneToDiseaseAssociation") AND (subject:"MONDO:0020121" OR subject_closure:"MONDO:0020121")',
'(category:"biolink:DiseaseToPhenotypicFeatureAssociation") AND (object:"MONDO:0020121" OR object_closure:"MONDO:0020121")',
Expand All @@ -28,6 +30,8 @@ def association_counts_query():
'(category:"biolink:GeneToGeneHomologyAssociation") AND (object:"MONDO:0020121" OR object_closure:"MONDO:0020121")',
'(category:"biolink:ChemicalToPathwayAssociation") AND (object:"MONDO:0020121" OR object_closure:"MONDO:0020121")',
'(category:"biolink:MacromolecularMachineToMolecularActivityAssociation") AND (object:"MONDO:0020121" OR object_closure:"MONDO:0020121")',
'(category:"biolink:MacromolecularMachineToCellularComponentAssociation") AND (object:"MONDO:0020121" OR object_closure:"MONDO:0020121")',
'(category:"biolink:MacromolecularMachineToBiologicalProcessAssociation") AND (object:"MONDO:0020121" OR object_closure:"MONDO:0020121")',
'(category:"biolink:CausalGeneToDiseaseAssociation") AND (object:"MONDO:0020121" OR object_closure:"MONDO:0020121")',
'(category:"biolink:CorrelatedGeneToDiseaseAssociation") AND (object:"MONDO:0020121" OR object_closure:"MONDO:0020121")',
],
Expand Down
4,280 changes: 1,410 additions & 2,870 deletions backend/tests/fixtures/association_counts_response.py

Large diffs are not rendered by default.

4,270 changes: 1,401 additions & 2,869 deletions backend/tests/fixtures/association_response.py

Large diffs are not rendered by default.

24 changes: 10 additions & 14 deletions backend/tests/fixtures/association_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def association_table():
"total": 4027,
"items": [
{
"id": "uuid:aafbc2e0-6c84-11ee-9c86-072f86c27f6e",
"id": "uuid:89aa7b9b-5d8c-11ee-9b27-2b20ed86a9d9",
"category": "biolink:DiseaseToPhenotypicFeatureAssociation",
"subject": "MONDO:0020793",
"original_subject": "OMIM:164310",
Expand Down Expand Up @@ -170,7 +170,7 @@ def association_table():
"aggregator_knowledge_source": ["infores:monarchinitiative"],
"negated": None,
"pathway": None,
"evidence_count": 4,
"evidence_count": 6,
"has_evidence": ["ECO:0000269"],
"has_evidence_links": [{"id": "ECO:0000269", "url": "http://purl.obolibrary.org/obo/ECO_0000269"}],
"provided_by": "hpoa_disease_to_phenotype_edges",
Expand Down Expand Up @@ -212,7 +212,7 @@ def association_table():
"direction": "outgoing",
},
{
"id": "uuid:aafbc2f1-6c84-11ee-9c86-072f86c27f6e",
"id": "uuid:89aa7bac-5d8c-11ee-9b27-2b20ed86a9d9",
"category": "biolink:DiseaseToPhenotypicFeatureAssociation",
"subject": "MONDO:0020793",
"original_subject": "OMIM:164310",
Expand Down Expand Up @@ -427,7 +427,7 @@ def association_table():
"aggregator_knowledge_source": ["infores:monarchinitiative"],
"negated": None,
"pathway": None,
"evidence_count": 4,
"evidence_count": 6,
"has_evidence": ["ECO:0000269"],
"has_evidence_links": [{"id": "ECO:0000269", "url": "http://purl.obolibrary.org/obo/ECO_0000269"}],
"provided_by": "hpoa_disease_to_phenotype_edges",
Expand Down Expand Up @@ -469,7 +469,7 @@ def association_table():
"direction": "outgoing",
},
{
"id": "uuid:a77a5b0a-6c84-11ee-9c86-072f86c27f6e",
"id": "uuid:862bc0d4-5d8c-11ee-9b27-2b20ed86a9d9",
"category": "biolink:DiseaseToPhenotypicFeatureAssociation",
"subject": "MONDO:0013049",
"original_subject": "OMIM:612937",
Expand Down Expand Up @@ -660,9 +660,7 @@ def association_table():
"entity",
"continuant",
"continuant",
"occurrent",
"independent continuant",
"process",
"specifically dependent continuant",
"material entity",
"gas molecular entity",
Expand Down Expand Up @@ -691,8 +689,6 @@ def association_table():
"nitrogen molecular entity",
"creatine kinase complex",
"cellular_component",
"biological_process",
"metabolic process",
"protein-containing complex",
"transferase complex, transferring phosphorus-containing groups",
"catalytic complex",
Expand Down Expand Up @@ -760,7 +756,7 @@ def association_table():
"aggregator_knowledge_source": ["infores:monarchinitiative"],
"negated": None,
"pathway": None,
"evidence_count": 3,
"evidence_count": 5,
"has_evidence": ["ECO:0000269"],
"has_evidence_links": [{"id": "ECO:0000269", "url": "http://purl.obolibrary.org/obo/ECO_0000269"}],
"provided_by": "hpoa_disease_to_phenotype_edges",
Expand Down Expand Up @@ -801,7 +797,7 @@ def association_table():
"direction": "outgoing",
},
{
"id": "uuid:abeb7c29-6c84-11ee-9c86-072f86c27f6e",
"id": "uuid:8a99d6f0-5d8c-11ee-9b27-2b20ed86a9d9",
"category": "biolink:DiseaseToPhenotypicFeatureAssociation",
"subject": "MONDO:0009681",
"original_subject": "OMIM:254090",
Expand Down Expand Up @@ -960,7 +956,7 @@ def association_table():
"aggregator_knowledge_source": ["infores:monarchinitiative"],
"negated": None,
"pathway": None,
"evidence_count": 3,
"evidence_count": 5,
"has_evidence": ["ECO:0000269"],
"has_evidence_links": [{"id": "ECO:0000269", "url": "http://purl.obolibrary.org/obo/ECO_0000269"}],
"provided_by": "hpoa_disease_to_phenotype_edges",
Expand Down Expand Up @@ -1001,7 +997,7 @@ def association_table():
"direction": "outgoing",
},
{
"id": "uuid:aa9b85eb-6c84-11ee-9c86-072f86c27f6e",
"id": "uuid:894ab8ce-5d8c-11ee-9b27-2b20ed86a9d9",
"category": "biolink:DiseaseToPhenotypicFeatureAssociation",
"subject": "MONDO:0009676",
"original_subject": "OMIM:253601",
Expand Down Expand Up @@ -1158,7 +1154,7 @@ def association_table():
"aggregator_knowledge_source": ["infores:monarchinitiative"],
"negated": None,
"pathway": None,
"evidence_count": 3,
"evidence_count": 5,
"has_evidence": ["ECO:0000269"],
"has_evidence_links": [{"id": "ECO:0000269", "url": "http://purl.obolibrary.org/obo/ECO_0000269"}],
"provided_by": "hpoa_disease_to_phenotype_edges",
Expand Down
26 changes: 11 additions & 15 deletions backend/tests/fixtures/association_table_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
def association_table_response():
return {
"responseHeader": {
"QTime": 0,
"QTime": 1,
"params": {
"mm": "100%",
"q": "*:*",
Expand All @@ -26,7 +26,7 @@ def association_table_response():
"start": 0,
"docs": [
{
"id": "uuid:aafbc2e0-6c84-11ee-9c86-072f86c27f6e",
"id": "uuid:89aa7b9b-5d8c-11ee-9b27-2b20ed86a9d9",
"original_subject": "OMIM:164310",
"predicate": "biolink:has_phenotype",
"category": "biolink:DiseaseToPhenotypicFeatureAssociation",
Expand Down Expand Up @@ -189,10 +189,10 @@ def association_table_response():
"frequency_qualifier_closure": ["HP:0000001", "HP:0040282", "HP:0040279"],
"frequency_qualifier_closure_label": ["All (HPO)", "Frequency (HPO)", "Frequent (HPO)"],
"frequency_qualifier_label": "Frequent (HPO)",
"evidence_count": 4,
"evidence_count": 6,
},
{
"id": "uuid:aafbc2f1-6c84-11ee-9c86-072f86c27f6e",
"id": "uuid:89aa7bac-5d8c-11ee-9b27-2b20ed86a9d9",
"original_subject": "OMIM:164310",
"predicate": "biolink:has_phenotype",
"category": "biolink:DiseaseToPhenotypicFeatureAssociation",
Expand Down Expand Up @@ -409,10 +409,10 @@ def association_table_response():
"frequency_qualifier_closure": ["HP:0000001", "HP:0040282", "HP:0040279"],
"frequency_qualifier_closure_label": ["All (HPO)", "Frequency (HPO)", "Frequent (HPO)"],
"frequency_qualifier_label": "Frequent (HPO)",
"evidence_count": 4,
"evidence_count": 6,
},
{
"id": "uuid:a77a5b0a-6c84-11ee-9c86-072f86c27f6e",
"id": "uuid:862bc0d4-5d8c-11ee-9b27-2b20ed86a9d9",
"original_subject": "OMIM:612937",
"predicate": "biolink:has_phenotype",
"category": "biolink:DiseaseToPhenotypicFeatureAssociation",
Expand Down Expand Up @@ -605,9 +605,7 @@ def association_table_response():
"entity",
"continuant",
"continuant",
"occurrent",
"independent continuant",
"process",
"specifically dependent continuant",
"material entity",
"gas molecular entity",
Expand Down Expand Up @@ -636,8 +634,6 @@ def association_table_response():
"nitrogen molecular entity",
"creatine kinase complex",
"cellular_component",
"biological_process",
"metabolic process",
"protein-containing complex",
"transferase complex, transferring phosphorus-containing groups",
"catalytic complex",
Expand Down Expand Up @@ -705,10 +701,10 @@ def association_table_response():
"frequency_qualifier_closure": ["HP:0000001", "HP:0040279", "HP:0040280"],
"frequency_qualifier_closure_label": ["All (HPO)", "Frequency (HPO)", "Obligate (HPO)"],
"frequency_qualifier_label": "Obligate (HPO)",
"evidence_count": 3,
"evidence_count": 5,
},
{
"id": "uuid:abeb7c29-6c84-11ee-9c86-072f86c27f6e",
"id": "uuid:8a99d6f0-5d8c-11ee-9b27-2b20ed86a9d9",
"original_subject": "OMIM:254090",
"predicate": "biolink:has_phenotype",
"category": "biolink:DiseaseToPhenotypicFeatureAssociation",
Expand Down Expand Up @@ -869,10 +865,10 @@ def association_table_response():
"frequency_qualifier_closure": ["HP:0000001", "HP:0040279", "HP:0040280"],
"frequency_qualifier_closure_label": ["All (HPO)", "Frequency (HPO)", "Obligate (HPO)"],
"frequency_qualifier_label": "Obligate (HPO)",
"evidence_count": 3,
"evidence_count": 5,
},
{
"id": "uuid:aa9b85eb-6c84-11ee-9c86-072f86c27f6e",
"id": "uuid:894ab8ce-5d8c-11ee-9b27-2b20ed86a9d9",
"original_subject": "OMIM:253601",
"predicate": "biolink:has_phenotype",
"category": "biolink:DiseaseToPhenotypicFeatureAssociation",
Expand Down Expand Up @@ -1031,7 +1027,7 @@ def association_table_response():
"frequency_qualifier_closure": ["HP:0000001", "HP:0040279", "HP:0040280"],
"frequency_qualifier_closure_label": ["All (HPO)", "Frequency (HPO)", "Obligate (HPO)"],
"frequency_qualifier_label": "Obligate (HPO)",
"evidence_count": 3,
"evidence_count": 5,
},
],
},
Expand Down
Loading

0 comments on commit 6b0128b

Please sign in to comment.