Skip to content

Commit

Permalink
Fixture update, plus formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinschaper committed Aug 11, 2023
1 parent 63bc5c3 commit f5018cf
Show file tree
Hide file tree
Showing 10 changed files with 88 additions and 69 deletions.
6 changes: 5 additions & 1 deletion backend/src/monarch_py/api/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ def _association_table(
title="Type of association to retrieve association table data for",
),
query: str = Query(None, example="thumb", title="Query string to limit results to a subset"),
sort: List[str] = Query(None, example=["subject_label asc", "predicate asc", "object_label asc"], title="Sort results by a list of field + direction statements"),
sort: List[str] = Query(
None,
example=["subject_label asc", "predicate asc", "object_label asc"],
title="Sort results by a list of field + direction statements",
),
pagination: PaginationParams = Depends(),
) -> AssociationTableResults:
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,10 @@ def get_association_table(
self,
entity: str,
category: str,
q: str =None,
sort: List[str]=None,
offset: int=0,
limit: int =5,
q: str = None,
sort: List[str] = None,
offset: int = 0,
limit: int = 5,
) -> AssociationTableResults:

query = build_association_table_query(
Expand Down
2 changes: 1 addition & 1 deletion 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 Down
47 changes: 26 additions & 21 deletions backend/tests/fixtures/autocomplete.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,32 @@ def autocomplete():
"offset": 0,
"total": 195,
"items": [
{
"id": "MONDO:0019391",
"category": "biolink:Disease",
"name": "Fanconi anemia",
"full_name": None,
"description": "Fanconi anemia (FA) is a hereditary DNA repair disorder characterized by progressive pancytopenia with bone marrow failure, variable congenital malformations and predisposition to develop hematological or solid tumors.",
"xref": [
"DOID:13636",
"GARD:0006425",
"ICD9:284.09",
"MESH:D005199",
"MedDRA:10055206",
"NCIT:C62505",
"OMIMPS:227650",
"Orphanet:84",
"SCTID:30575002",
"UMLS:C0015625",
],
"provided_by": "phenio_nodes",
"in_taxon": None,
"in_taxon_label": None,
"symbol": None,
"synonym": [],
"highlight": None,
"score": None,
},
{
"id": "MONDO:0001083",
"category": "biolink:Disease",
Expand Down Expand Up @@ -353,27 +379,6 @@ def autocomplete():
"highlight": None,
"score": None,
},
{
"id": "MONDO:0012186",
"category": "biolink:Disease",
"name": "Fanconi anemia complementation group I",
"full_name": None,
"description": "Fanconi anemia caused by mutations in the FANCI gene, encoding Fanconi anemia group I protein.",
"xref": [
"DOID:0111091",
"MESH:C563802",
"NCIT:C129026",
"OMIM:609053",
"UMLS:C1836861",
],
"provided_by": "phenio_nodes",
"in_taxon": None,
"in_taxon_label": None,
"symbol": None,
"synonym": [],
"highlight": None,
"score": None,
},
],
"facet_fields": [],
"facet_queries": [],
Expand Down
2 changes: 1 addition & 1 deletion backend/tests/fixtures/autocomplete_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def autocomplete_query():
return {
"q": "fanc",
"rows": 20,
"start": 1,
"start": 0,
"facet": True,
"facet_fields": [],
"facet_queries": [],
Expand Down
37 changes: 21 additions & 16 deletions backend/tests/fixtures/autocomplete_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,35 @@ def autocomplete_response():
"defType": "edismax",
"facet_min_count": "1",
"qf": "id^100 name^10 name_t^5 name_ac symbol^10 symbol_t^5 symbol_ac synonym synonym_t synonym_ac",
"start": "1",
"start": "0",
"boost": 'product(if(termfreq(category,"biolink:Disease"),10.0,1),if(and(termfreq(in_taxon,"NCBITaxon:9606"),termfreq(category,"biolink:Gene")),5.0,1))',
"rows": "20",
"facet": "true",
},
},
"response": {
"num_found": 195,
"start": 1,
"start": 0,
"docs": [
{
"id": "MONDO:0019391",
"category": "biolink:Disease",
"name": "Fanconi anemia",
"xref": [
"DOID:13636",
"GARD:0006425",
"ICD9:284.09",
"MESH:D005199",
"MedDRA:10055206",
"NCIT:C62505",
"OMIMPS:227650",
"Orphanet:84",
"SCTID:30575002",
"UMLS:C0015625",
],
"provided_by": "phenio_nodes",
"description": "Fanconi anemia (FA) is a hereditary DNA repair disorder characterized by progressive pancytopenia with bone marrow failure, variable congenital malformations and predisposition to develop hematological or solid tumors.",
},
{
"id": "MONDO:0001083",
"category": "biolink:Disease",
Expand Down Expand Up @@ -235,20 +254,6 @@ def autocomplete_response():
"provided_by": "phenio_nodes",
"description": "Inherited cancer-predisposing syndrome due to biallelic BRCA2 mutations is a rare cancer-predisposing syndrome, associated with the D1 subgroup of Fanconi anemia (FA), characterized by progressive bone marrow failure, cardiac, brain, intestinal or skeletal abnormalities and predisposition to various malignancies. Bone marrow suppression and the incidence of developmental abnormalities are less frequent than in other FA, but cancer risk is very high with the spectrum of childhood cancers including Wilms tumor, brain tumor (often medulloblastoma) and ALL/AML.",
},
{
"id": "MONDO:0012186",
"category": "biolink:Disease",
"name": "Fanconi anemia complementation group I",
"xref": [
"DOID:0111091",
"MESH:C563802",
"NCIT:C129026",
"OMIM:609053",
"UMLS:C1836861",
],
"provided_by": "phenio_nodes",
"description": "Fanconi anemia caused by mutations in the FANCI gene, encoding Fanconi anemia group I protein.",
},
],
},
"facet_counts": {"facet_fields": {}, "facet_queries": {}},
Expand Down
2 changes: 1 addition & 1 deletion backend/tests/fixtures/histopheno_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
def histopheno_response():
return {
"responseHeader": {
"QTime": 2,
"QTime": 1,
"params": {
"facet.query": [
'object_closure:"HP:0000924"',
Expand Down
2 changes: 1 addition & 1 deletion backend/tests/fixtures/search_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
def search_response():
return {
"responseHeader": {
"QTime": 0,
"QTime": 1,
"params": {
"mm": "100%",
"q": "fanconi",
Expand Down
4 changes: 2 additions & 2 deletions frontend/fixtures/association-table.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"human disease or disorder"
],
"subject_taxon": null,
"subject_taxon_label": "test subject taxon label",
"subject_taxon_label": null,
"predicate": "biolink:has_phenotype",
"object": "HP:0002460",
"original_object": null,
Expand Down Expand Up @@ -134,7 +134,7 @@
"organ system subdivision"
],
"object_taxon": null,
"object_taxon_label": "test object taxon label",
"object_taxon_label": null,
"primary_knowledge_source": "infores:hpo-annotations",
"aggregator_knowledge_source": ["infores:monarchinitiative"],
"category": "biolink:DiseaseToPhenotypicFeatureAssociation",
Expand Down
47 changes: 26 additions & 21 deletions frontend/fixtures/autocomplete.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,32 @@
"offset": 0,
"total": 195,
"items": [
{
"id": "MONDO:0019391",
"category": "biolink:Disease",
"name": "Fanconi anemia",
"full_name": null,
"description": "Fanconi anemia (FA) is a hereditary DNA repair disorder characterized by progressive pancytopenia with bone marrow failure, variable congenital malformations and predisposition to develop hematological or solid tumors.",
"xref": [
"DOID:13636",
"GARD:0006425",
"ICD9:284.09",
"MESH:D005199",
"MedDRA:10055206",
"NCIT:C62505",
"OMIMPS:227650",
"Orphanet:84",
"SCTID:30575002",
"UMLS:C0015625"
],
"provided_by": "phenio_nodes",
"in_taxon": null,
"in_taxon_label": null,
"symbol": null,
"synonym": [],
"highlight": null,
"score": null
},
{
"id": "MONDO:0001083",
"category": "biolink:Disease",
Expand Down Expand Up @@ -332,27 +358,6 @@
"synonym": [],
"highlight": null,
"score": null
},
{
"id": "MONDO:0012186",
"category": "biolink:Disease",
"name": "Fanconi anemia complementation group I",
"full_name": null,
"description": "Fanconi anemia caused by mutations in the FANCI gene, encoding Fanconi anemia group I protein.",
"xref": [
"DOID:0111091",
"MESH:C563802",
"NCIT:C129026",
"OMIM:609053",
"UMLS:C1836861"
],
"provided_by": "phenio_nodes",
"in_taxon": null,
"in_taxon_label": null,
"symbol": null,
"synonym": [],
"highlight": null,
"score": null
}
],
"facet_fields": [],
Expand Down

0 comments on commit f5018cf

Please sign in to comment.