From 5173608de0bc10fed3a49ef4472094676d54f0fb Mon Sep 17 00:00:00 2001 From: Kevin Schaper Date: Mon, 22 Apr 2024 19:03:24 -0700 Subject: [PATCH] Adds xref to searched fields, plus test (#681) Adds xref to searched fields, and an integration test to confirm it --- .../implementations/solr/solr_query_utils.py | 2 +- backend/tests/fixtures/autocomplete_query.py | 2 +- .../tests/fixtures/autocomplete_response.py | 4 +- backend/tests/fixtures/search_query.py | 2 +- backend/tests/fixtures/search_response.py | 4 +- backend/tests/integration/test_solr_search.py | 1 + .../fixtures/phenotype-explorer-compare.json | 18 +- .../phenotype-explorer-multi-compare.json | 296 +++++++++--------- .../fixtures/phenotype-explorer-search.json | 68 ++-- 9 files changed, 199 insertions(+), 198 deletions(-) diff --git a/backend/src/monarch_py/implementations/solr/solr_query_utils.py b/backend/src/monarch_py/implementations/solr/solr_query_utils.py index 7130315da..d48281d01 100644 --- a/backend/src/monarch_py/implementations/solr/solr_query_utils.py +++ b/backend/src/monarch_py/implementations/solr/solr_query_utils.py @@ -294,7 +294,7 @@ def entity_query_fields(): """ Fields and boosts used for entity search, includes autocomplete fields and expands upon them beyond pure name fields """ - return f"{autocomplete_query_fields()} description_t" + return f"{autocomplete_query_fields()} description_t xref" def association_search_query_fields(): diff --git a/backend/tests/fixtures/autocomplete_query.py b/backend/tests/fixtures/autocomplete_query.py index e1eff3e3e..4e578d7b3 100644 --- a/backend/tests/fixtures/autocomplete_query.py +++ b/backend/tests/fixtures/autocomplete_query.py @@ -12,7 +12,7 @@ def autocomplete_query(): "facet_fields": [], "facet_queries": [], "filter_queries": [], - "query_fields": "id^100 name^10 name_t^5 name_ac symbol^10 symbol_t^5 symbol_ac synonym synonym_t synonym_ac description_t", + "query_fields": "id^100 name^10 name_t^5 name_ac symbol^10 symbol_t^5 symbol_ac synonym synonym_t synonym_ac description_t xref", "def_type": "edismax", "q_op": "AND", "mm": "100%", diff --git a/backend/tests/fixtures/autocomplete_response.py b/backend/tests/fixtures/autocomplete_response.py index 5434d11ba..75fa7c7bf 100644 --- a/backend/tests/fixtures/autocomplete_response.py +++ b/backend/tests/fixtures/autocomplete_response.py @@ -5,13 +5,13 @@ def autocomplete_response(): return { "responseHeader": { - "QTime": 1, + "QTime": 0, "params": { "mm": "100%", "q": "fanc", "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 description_t", + "qf": "id^100 name^10 name_t^5 name_ac symbol^10 symbol_t^5 symbol_ac synonym synonym_t synonym_ac description_t xref", "start": "0", "q.op": "AND", "boost": 'product(if(termfreq(category,"biolink:PhenotypicFeature"),1.1,1),if(termfreq(category,"biolink:Disease"),1.3,1),if(and(termfreq(in_taxon,"NCBITaxon:9606"),termfreq(category,"biolink:Gene")),1.1,1),if(termfreq(deprecated,"true"),0.1,1))', diff --git a/backend/tests/fixtures/search_query.py b/backend/tests/fixtures/search_query.py index 9571e1a24..33829b5c5 100644 --- a/backend/tests/fixtures/search_query.py +++ b/backend/tests/fixtures/search_query.py @@ -12,7 +12,7 @@ def search_query(): "facet_fields": [], "facet_queries": [], "filter_queries": ["name:*"], - "query_fields": "id^100 name^10 name_t^5 name_ac symbol^10 symbol_t^5 symbol_ac synonym synonym_t synonym_ac description_t", + "query_fields": "id^100 name^10 name_t^5 name_ac symbol^10 symbol_t^5 symbol_ac synonym synonym_t synonym_ac description_t xref", "def_type": "edismax", "q_op": "AND", "mm": "100%", diff --git a/backend/tests/fixtures/search_response.py b/backend/tests/fixtures/search_response.py index c89d34a65..4c5ee2f26 100644 --- a/backend/tests/fixtures/search_response.py +++ b/backend/tests/fixtures/search_response.py @@ -5,13 +5,13 @@ def search_response(): return { "responseHeader": { - "QTime": 3, + "QTime": 2, "params": { "mm": "100%", "q": "fanconi", "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 description_t", + "qf": "id^100 name^10 name_t^5 name_ac symbol^10 symbol_t^5 symbol_ac synonym synonym_t synonym_ac description_t xref", "start": "0", "q.op": "AND", "boost": 'product(if(termfreq(category,"biolink:PhenotypicFeature"),1.1,1),if(termfreq(category,"biolink:Disease"),1.3,1),if(and(termfreq(in_taxon,"NCBITaxon:9606"),termfreq(category,"biolink:Gene")),1.1,1),if(termfreq(deprecated,"true"),0.1,1))', diff --git a/backend/tests/integration/test_solr_search.py b/backend/tests/integration/test_solr_search.py index 2eda3e97e..9beb5632e 100644 --- a/backend/tests/integration/test_solr_search.py +++ b/backend/tests/integration/test_solr_search.py @@ -20,6 +20,7 @@ # Failing because we don't have synonyms coming in from Phenio (!) # "AD16", "symphalangism, C. S. Lewis type", + "OMIM:301045", # Confirmation that we load & search xrefs for Mondo ], ) def test_search_query_has_some_results(query: str): diff --git a/frontend/fixtures/phenotype-explorer-compare.json b/frontend/fixtures/phenotype-explorer-compare.json index ec68ccf92..33edf866b 100644 --- a/frontend/fixtures/phenotype-explorer-compare.json +++ b/frontend/fixtures/phenotype-explorer-compare.json @@ -1,12 +1,12 @@ { "subject_termset": { - "MP:0002169": { - "id": "MP:0002169", - "label": "no abnormal phenotype detected (MPO)" - }, "MP:0010771": { "id": "MP:0010771", "label": "integument phenotype (MPO)" + }, + "MP:0002169": { + "id": "MP:0002169", + "label": "no abnormal phenotype detected (MPO)" } }, "object_termset": { @@ -77,8 +77,8 @@ "HP:0004325": { "match_source": "HP:0004325", "match_source_label": "Decreased body weight (HPO)", - "match_target": "MP:0002169", - "match_target_label": "no abnormal phenotype detected (MPO)", + "match_target": "MP:0010771", + "match_target_label": "integument phenotype (MPO)", "score": 1.5540019332516637, "match_subsumer": null, "match_subsumer_label": null, @@ -86,7 +86,7 @@ "subject_id": "HP:0004325", "subject_label": null, "subject_source": null, - "object_id": "MP:0002169", + "object_id": "MP:0010771", "object_label": null, "object_source": null, "ancestor_id": "UPHENO:0001003", @@ -95,10 +95,10 @@ "object_information_content": null, "subject_information_content": null, "ancestor_information_content": 1.5540019332516637, - "jaccard_similarity": 0.23076923076923078, + "jaccard_similarity": 0.24, "cosine_similarity": null, "dice_similarity": null, - "phenodigm_score": 0.5988454147360435 + "phenodigm_score": 0.61070489107293 }, "score_metric": "ancestor_information_content" } diff --git a/frontend/fixtures/phenotype-explorer-multi-compare.json b/frontend/fixtures/phenotype-explorer-multi-compare.json index 6b0ea6fbe..9c7093367 100644 --- a/frontend/fixtures/phenotype-explorer-multi-compare.json +++ b/frontend/fixtures/phenotype-explorer-multi-compare.json @@ -22,45 +22,45 @@ "has_phenotype_closure_label": [], "has_phenotype_count": null }, - "score": 0.5499139182472517, + "score": 0.5499139182472516, "similarity": { "subject_termset": { + "HP:0001533": { "id": "HP:0001533", "label": "Slender build (HPO)" }, + "HP:0012450": { + "id": "HP:0012450", + "label": "Chronic constipation (HPO)" + }, "HP:0004944": { "id": "HP:0004944", "label": "Dilatation of the cerebral artery (HPO)" }, - "HP:0002616": { - "id": "HP:0002616", - "label": "Aortic root aneurysm (HPO)" - }, - "HP:0001533": { "id": "HP:0001533", "label": "Slender build (HPO)" }, "HP:0002020": { "id": "HP:0002020", "label": "Gastroesophageal reflux (HPO)" }, "HP:0010749": { "id": "HP:0010749", "label": "Blepharochalasis (HPO)" }, - "HP:0012450": { - "id": "HP:0012450", - "label": "Chronic constipation (HPO)" - }, - "HP:0001763": { "id": "HP:0001763", "label": "Pes planus (HPO)" } - }, - "object_termset": { - "HP:0000268": { "id": "HP:0000268", "label": "Dolichocephaly (HPO)" }, + "HP:0001763": { "id": "HP:0001763", "label": "Pes planus (HPO)" }, "HP:0002616": { "id": "HP:0002616", "label": "Aortic root aneurysm (HPO)" - }, + } + }, + "object_termset": { "HP:0100785": { "id": "HP:0100785", "label": "Insomnia (HPO)" }, - "HP:0000023": { "id": "HP:0000023", "label": "Inguinal hernia (HPO)" }, "HP:0000490": { "id": "HP:0000490", "label": "Deeply set eye (HPO)" }, - "HP:0001763": { "id": "HP:0001763", "label": "Pes planus (HPO)" }, "HP:0002108": { "id": "HP:0002108", "label": "Spontaneous pneumothorax (HPO)" }, "HP:0000545": { "id": "HP:0000545", "label": "Myopia (HPO)" }, - "HP:0000767": { "id": "HP:0000767", "label": "Pectus excavatum (HPO)" } + "HP:0001763": { "id": "HP:0001763", "label": "Pes planus (HPO)" }, + "HP:0000023": { "id": "HP:0000023", "label": "Inguinal hernia (HPO)" }, + "HP:0000268": { "id": "HP:0000268", "label": "Dolichocephaly (HPO)" }, + "HP:0000767": { "id": "HP:0000767", "label": "Pectus excavatum (HPO)" }, + "HP:0002616": { + "id": "HP:0002616", + "label": "Aortic root aneurysm (HPO)" + } }, "subject_best_matches": { "HP:0001533": { @@ -206,16 +206,16 @@ "HP:0010749": { "match_source": "HP:0010749", "match_source_label": "Blepharochalasis (HPO)", - "match_target": "HP:0000490", - "match_target_label": "Deeply set eye (HPO)", - "score": 0.4, + "match_target": "HP:0000545", + "match_target_label": "Myopia (HPO)", + "score": 0.3389830508474576, "match_subsumer": null, "match_subsumer_label": null, "similarity": { "subject_id": "HP:0010749", "subject_label": null, "subject_source": null, - "object_id": "HP:0000490", + "object_id": "HP:0000545", "object_label": null, "object_source": null, "ancestor_id": "HP:0000315", @@ -224,10 +224,10 @@ "object_information_content": null, "subject_information_content": null, "ancestor_information_content": 7.709281511796768, - "jaccard_similarity": 0.4, + "jaccard_similarity": 0.3389830508474576, "cosine_similarity": null, "dice_similarity": null, - "phenodigm_score": 1.7560502853616429 + "phenodigm_score": 1.6165753204570361 }, "score_metric": "jaccard_similarity" }, @@ -432,16 +432,16 @@ "HP:0002108": { "match_source": "HP:0002108", "match_source_label": "Spontaneous pneumothorax (HPO)", - "match_target": "HP:0001763", - "match_target_label": "Pes planus (HPO)", - "score": 0.32653061224489793, + "match_target": "HP:0002616", + "match_target_label": "Aortic root aneurysm (HPO)", + "score": 0.35555555555555557, "match_subsumer": null, "match_subsumer_label": null, "similarity": { "subject_id": "HP:0002108", "subject_label": null, "subject_source": null, - "object_id": "HP:0001763", + "object_id": "HP:0002616", "object_label": null, "object_source": null, "ancestor_id": "HP:0000118", @@ -450,10 +450,10 @@ "object_information_content": null, "subject_information_content": null, "ancestor_information_content": 4.118848568918744, - "jaccard_similarity": 0.32653061224489793, + "jaccard_similarity": 0.35555555555555557, "cosine_similarity": null, "dice_similarity": null, - "phenodigm_score": 1.1597112334340214 + "phenodigm_score": 1.2101568043733462 }, "score_metric": "jaccard_similarity" }, @@ -514,7 +514,7 @@ "score_metric": "jaccard_similarity" } }, - "average_score": 0.5499139182472517, + "average_score": 0.5499139182472516, "best_score": 1.0, "metric": "JaccardSimilarity" } @@ -542,20 +542,12 @@ "has_phenotype_closure_label": [], "has_phenotype_count": null }, - "score": 0.8349755882492099, + "score": 0.83497558824921, "similarity": { "subject_termset": { - "HP:0010749": { "id": "HP:0010749", "label": "Blepharochalasis (HPO)" }, "HP:0001763": { "id": "HP:0001763", "label": "Pes planus (HPO)" }, "HP:0001533": { "id": "HP:0001533", "label": "Slender build (HPO)" }, - "HP:0012450": { - "id": "HP:0012450", - "label": "Chronic constipation (HPO)" - }, - "HP:0002020": { - "id": "HP:0002020", - "label": "Gastroesophageal reflux (HPO)" - }, + "HP:0010749": { "id": "HP:0010749", "label": "Blepharochalasis (HPO)" }, "HP:0002616": { "id": "HP:0002616", "label": "Aortic root aneurysm (HPO)" @@ -563,48 +555,56 @@ "HP:0004944": { "id": "HP:0004944", "label": "Dilatation of the cerebral artery (HPO)" + }, + "HP:0012450": { + "id": "HP:0012450", + "label": "Chronic constipation (HPO)" + }, + "HP:0002020": { + "id": "HP:0002020", + "label": "Gastroesophageal reflux (HPO)" } }, "object_termset": { - "HP:0002829": { "id": "HP:0002829", "label": "Arthralgia (HPO)" }, - "HP:0010749": { "id": "HP:0010749", "label": "Blepharochalasis (HPO)" }, + "HP:0003394": { "id": "HP:0003394", "label": "Muscle spasm (HPO)" }, "HP:0001763": { "id": "HP:0001763", "label": "Pes planus (HPO)" }, + "HP:0001278": { + "id": "HP:0001278", + "label": "Orthostatic hypotension (HPO)" + }, "HP:0001533": { "id": "HP:0001533", "label": "Slender build (HPO)" }, - "HP:0012378": { "id": "HP:0012378", "label": "Fatigue (HPO)" }, + "HP:0010749": { "id": "HP:0010749", "label": "Blepharochalasis (HPO)" }, "HP:0002999": { "id": "HP:0002999", "label": "Patellar dislocation (HPO)" }, - "HP:0001278": { - "id": "HP:0001278", - "label": "Orthostatic hypotension (HPO)" - }, "HP:0003771": { "id": "HP:0003771", "label": "Pulp calcification (HPO)" }, + "HP:0002616": { + "id": "HP:0002616", + "label": "Aortic root aneurysm (HPO)" + }, "HP:0002827": { "id": "HP:0002827", "label": "Hip dislocation (HPO)" }, + "HP:0002829": { "id": "HP:0002829", "label": "Arthralgia (HPO)" }, + "HP:0004944": { + "id": "HP:0004944", + "label": "Dilatation of the cerebral artery (HPO)" + }, "HP:0012450": { "id": "HP:0012450", "label": "Chronic constipation (HPO)" }, - "HP:0002020": { - "id": "HP:0002020", - "label": "Gastroesophageal reflux (HPO)" - }, - "HP:0002616": { - "id": "HP:0002616", - "label": "Aortic root aneurysm (HPO)" - }, "HP:0003010": { "id": "HP:0003010", "label": "Prolonged bleeding time (HPO)" }, - "HP:0004944": { - "id": "HP:0004944", - "label": "Dilatation of the cerebral artery (HPO)" - }, - "HP:0003394": { "id": "HP:0003394", "label": "Muscle spasm (HPO)" } + "HP:0012378": { "id": "HP:0012378", "label": "Fatigue (HPO)" }, + "HP:0002020": { + "id": "HP:0002020", + "label": "Gastroesophageal reflux (HPO)" + } }, "subject_best_matches": { "HP:0001533": { @@ -808,16 +808,16 @@ "HP:0001278": { "match_source": "HP:0001278", "match_source_label": "Orthostatic hypotension (HPO)", - "match_target": "HP:0004944", - "match_target_label": "Dilatation of the cerebral artery (HPO)", - "score": 0.2903225806451613, + "match_target": "HP:0002616", + "match_target_label": "Aortic root aneurysm (HPO)", + "score": 0.3076923076923077, "match_subsumer": null, "match_subsumer_label": null, "similarity": { "subject_id": "HP:0001278", "subject_label": null, "subject_source": null, - "object_id": "HP:0004944", + "object_id": "HP:0002616", "object_label": null, "object_source": null, "ancestor_id": "HP:0002597", @@ -826,10 +826,10 @@ "object_information_content": null, "subject_information_content": null, "ancestor_information_content": 8.38058018831398, - "jaccard_similarity": 0.2903225806451613, + "jaccard_similarity": 0.3076923076923077, "cosine_similarity": null, "dice_similarity": null, - "phenodigm_score": 1.55983065349256 + "phenodigm_score": 1.6058144531491685 }, "score_metric": "jaccard_similarity" }, @@ -976,16 +976,16 @@ "HP:0002829": { "match_source": "HP:0002829", "match_source_label": "Arthralgia (HPO)", - "match_target": "HP:0002616", - "match_target_label": "Aortic root aneurysm (HPO)", - "score": 0.2631578947368421, + "match_target": "HP:0001763", + "match_target_label": "Pes planus (HPO)", + "score": 0.23809523809523808, "match_subsumer": null, "match_subsumer_label": null, "similarity": { "subject_id": "HP:0002829", "subject_label": null, "subject_source": null, - "object_id": "HP:0002616", + "object_id": "HP:0001763", "object_label": null, "object_source": null, "ancestor_id": "HP:0000118", @@ -994,10 +994,10 @@ "object_information_content": null, "subject_information_content": null, "ancestor_information_content": 4.118848568918744, - "jaccard_similarity": 0.2631578947368421, + "jaccard_similarity": 0.23809523809523808, "cosine_similarity": null, "dice_similarity": null, - "phenodigm_score": 1.0411087926516187 + "phenodigm_score": 0.990291992644058 }, "score_metric": "jaccard_similarity" }, @@ -1032,16 +1032,16 @@ "HP:0003010": { "match_source": "HP:0003010", "match_source_label": "Prolonged bleeding time (HPO)", - "match_target": "HP:0001533", - "match_target_label": "Slender build (HPO)", - "score": 0.25, + "match_target": "HP:0004944", + "match_target_label": "Dilatation of the cerebral artery (HPO)", + "score": 0.21568627450980393, "match_subsumer": null, "match_subsumer_label": null, "similarity": { "subject_id": "HP:0003010", "subject_label": null, "subject_source": null, - "object_id": "HP:0001533", + "object_id": "HP:0004944", "object_label": null, "object_source": null, "ancestor_id": "HP:0000118", @@ -1050,10 +1050,10 @@ "object_information_content": null, "subject_information_content": null, "ancestor_information_content": 4.118848568918744, - "jaccard_similarity": 0.25, + "jaccard_similarity": 0.21568627450980393, "cosine_similarity": null, "dice_similarity": null, - "phenodigm_score": 1.0147473292547686 + "phenodigm_score": 0.9425386480670812 }, "score_metric": "jaccard_similarity" }, @@ -1226,7 +1226,7 @@ "score_metric": "jaccard_similarity" } }, - "average_score": 0.8349755882492099, + "average_score": 0.83497558824921, "best_score": 1.0, "metric": "JaccardSimilarity" } @@ -1257,83 +1257,83 @@ "score": 0.5309539844387191, "similarity": { "subject_termset": { - "HP:0012450": { - "id": "HP:0012450", - "label": "Chronic constipation (HPO)" - }, - "HP:0001763": { "id": "HP:0001763", "label": "Pes planus (HPO)" }, "HP:0002616": { "id": "HP:0002616", "label": "Aortic root aneurysm (HPO)" }, "HP:0001533": { "id": "HP:0001533", "label": "Slender build (HPO)" }, - "HP:0010749": { "id": "HP:0010749", "label": "Blepharochalasis (HPO)" }, + "HP:0012450": { + "id": "HP:0012450", + "label": "Chronic constipation (HPO)" + }, "HP:0004944": { "id": "HP:0004944", "label": "Dilatation of the cerebral artery (HPO)" }, + "HP:0001763": { "id": "HP:0001763", "label": "Pes planus (HPO)" }, "HP:0002020": { "id": "HP:0002020", "label": "Gastroesophageal reflux (HPO)" - } + }, + "HP:0010749": { "id": "HP:0010749", "label": "Blepharochalasis (HPO)" } }, "object_termset": { - "HP:0100785": { "id": "HP:0100785", "label": "Insomnia (HPO)" }, + "HP:0012432": { "id": "HP:0012432", "label": "Chronic fatigue (HPO)" }, + "HP:0001659": { + "id": "HP:0001659", + "label": "Aortic regurgitation (HPO)" + }, + "HP:0002616": { + "id": "HP:0002616", + "label": "Aortic root aneurysm (HPO)" + }, "HP:0002705": { "id": "HP:0002705", "label": "High, narrow palate (HPO)" }, - "HP:0001634": { - "id": "HP:0001634", - "label": "Mitral valve prolapse (HPO)" - }, - "HP:0001659": { - "id": "HP:0001659", - "label": "Aortic regurgitation (HPO)" + "HP:0002108": { + "id": "HP:0002108", + "label": "Spontaneous pneumothorax (HPO)" }, - "HP:0001763": { "id": "HP:0001763", "label": "Pes planus (HPO)" }, - "HP:0004970": { - "id": "HP:0004970", - "label": "Ascending tubular aorta aneurysm (HPO)" + "HP:0000023": { "id": "HP:0000023", "label": "Inguinal hernia (HPO)" }, + "HP:0001653": { + "id": "HP:0001653", + "label": "Mitral regurgitation (HPO)" }, "HP:0002360": { "id": "HP:0002360", "label": "Sleep disturbance (HPO)" }, - "HP:0001653": { - "id": "HP:0001653", - "label": "Mitral regurgitation (HPO)" + "HP:0000545": { "id": "HP:0000545", "label": "Myopia (HPO)" }, + "HP:0000767": { "id": "HP:0000767", "label": "Pectus excavatum (HPO)" }, + "HP:0001704": { + "id": "HP:0001704", + "label": "Tricuspid valve prolapse (HPO)" + }, + "HP:0004970": { + "id": "HP:0004970", + "label": "Ascending tubular aorta aneurysm (HPO)" }, "HP:0007800": { "id": "HP:0007800", "label": "Increased axial length of the globe (HPO)" }, - "HP:0002616": { - "id": "HP:0002616", - "label": "Aortic root aneurysm (HPO)" - }, "HP:0000268": { "id": "HP:0000268", "label": "Dolichocephaly (HPO)" }, "HP:0003179": { "id": "HP:0003179", "label": "Protrusio acetabuli (HPO)" }, - "HP:0000545": { "id": "HP:0000545", "label": "Myopia (HPO)" }, - "HP:0000767": { "id": "HP:0000767", "label": "Pectus excavatum (HPO)" }, - "HP:0012432": { "id": "HP:0012432", "label": "Chronic fatigue (HPO)" }, "HP:0005059": { "id": "HP:0005059", "label": "Arthralgia/arthritis (HPO)" }, - "HP:0001704": { - "id": "HP:0001704", - "label": "Tricuspid valve prolapse (HPO)" - }, "HP:0000490": { "id": "HP:0000490", "label": "Deeply set eye (HPO)" }, - "HP:0002108": { - "id": "HP:0002108", - "label": "Spontaneous pneumothorax (HPO)" - }, - "HP:0000023": { "id": "HP:0000023", "label": "Inguinal hernia (HPO)" } + "HP:0001763": { "id": "HP:0001763", "label": "Pes planus (HPO)" }, + "HP:0100785": { "id": "HP:0100785", "label": "Insomnia (HPO)" }, + "HP:0001634": { + "id": "HP:0001634", + "label": "Mitral valve prolapse (HPO)" + } }, "subject_best_matches": { "HP:0001533": { @@ -1479,16 +1479,16 @@ "HP:0010749": { "match_source": "HP:0010749", "match_source_label": "Blepharochalasis (HPO)", - "match_target": "HP:0007800", - "match_target_label": "Increased axial length of the globe (HPO)", - "score": 0.38095238095238093, + "match_target": "HP:0000545", + "match_target_label": "Myopia (HPO)", + "score": 0.3389830508474576, "match_subsumer": null, "match_subsumer_label": null, "similarity": { "subject_id": "HP:0010749", "subject_label": null, "subject_source": null, - "object_id": "HP:0007800", + "object_id": "HP:0000545", "object_label": null, "object_source": null, "ancestor_id": "HP:0000315", @@ -1497,10 +1497,10 @@ "object_information_content": null, "subject_information_content": null, "ancestor_information_content": 7.709281511796768, - "jaccard_similarity": 0.38095238095238093, + "jaccard_similarity": 0.3389830508474576, "cosine_similarity": null, "dice_similarity": null, - "phenodigm_score": 1.7137296015857197 + "phenodigm_score": 1.6165753204570361 }, "score_metric": "jaccard_similarity" }, @@ -1677,16 +1677,16 @@ "HP:0001634": { "match_source": "HP:0001634", "match_source_label": "Mitral valve prolapse (HPO)", - "match_target": "HP:0004944", - "match_target_label": "Dilatation of the cerebral artery (HPO)", - "score": 0.3333333333333333, + "match_target": "HP:0002616", + "match_target_label": "Aortic root aneurysm (HPO)", + "score": 0.4166666666666667, "match_subsumer": null, "match_subsumer_label": null, "similarity": { "subject_id": "HP:0001634", "subject_label": null, "subject_source": null, - "object_id": "HP:0004944", + "object_id": "HP:0002616", "object_label": null, "object_source": null, "ancestor_id": "HP:0030680", @@ -1695,10 +1695,10 @@ "object_information_content": null, "subject_information_content": null, "ancestor_information_content": 8.449787463668223, - "jaccard_similarity": 0.3333333333333333, + "jaccard_similarity": 0.4166666666666667, "cosine_similarity": null, "dice_similarity": null, - "phenodigm_score": 1.6782716768219443 + "phenodigm_score": 1.8763647770432128 }, "score_metric": "jaccard_similarity" }, @@ -1733,16 +1733,16 @@ "HP:0001659": { "match_source": "HP:0001659", "match_source_label": "Aortic regurgitation (HPO)", - "match_target": "HP:0002616", - "match_target_label": "Aortic root aneurysm (HPO)", - "score": 0.3181818181818182, + "match_target": "HP:0004944", + "match_target_label": "Dilatation of the cerebral artery (HPO)", + "score": 0.25, "match_subsumer": null, "match_subsumer_label": null, "similarity": { "subject_id": "HP:0001659", "subject_label": null, "subject_source": null, - "object_id": "HP:0002616", + "object_id": "HP:0004944", "object_label": null, "object_source": null, "ancestor_id": "HP:0001626", @@ -1751,10 +1751,10 @@ "object_information_content": null, "subject_information_content": null, "ancestor_information_content": 7.652086110215225, - "jaccard_similarity": 0.3181818181818182, + "jaccard_similarity": 0.25, "cosine_similarity": null, "dice_similarity": null, - "phenodigm_score": 1.560370043109043 + "phenodigm_score": 1.3831202144259935 }, "score_metric": "jaccard_similarity" }, @@ -1817,16 +1817,16 @@ "HP:0002108": { "match_source": "HP:0002108", "match_source_label": "Spontaneous pneumothorax (HPO)", - "match_target": "HP:0010749", - "match_target_label": "Blepharochalasis (HPO)", - "score": 0.26229508196721313, + "match_target": "HP:0012450", + "match_target_label": "Chronic constipation (HPO)", + "score": 0.32432432432432434, "match_subsumer": null, "match_subsumer_label": null, "similarity": { "subject_id": "HP:0002108", "subject_label": null, "subject_source": null, - "object_id": "HP:0010749", + "object_id": "HP:0012450", "object_label": null, "object_source": null, "ancestor_id": "HP:0000118", @@ -1835,10 +1835,10 @@ "object_information_content": null, "subject_information_content": null, "ancestor_information_content": 4.118848568918744, - "jaccard_similarity": 0.26229508196721313, + "jaccard_similarity": 0.32432432432432434, "cosine_similarity": null, "dice_similarity": null, - "phenodigm_score": 1.0394006556641575 + "phenodigm_score": 1.155786649476789 }, "score_metric": "jaccard_similarity" }, @@ -2041,16 +2041,16 @@ "HP:0012432": { "match_source": "HP:0012432", "match_source_label": "Chronic fatigue (HPO)", - "match_target": "HP:0012450", - "match_target_label": "Chronic constipation (HPO)", - "score": 0.38461538461538464, + "match_target": "HP:0010749", + "match_target_label": "Blepharochalasis (HPO)", + "score": 0.18518518518518517, "match_subsumer": null, "match_subsumer_label": null, "similarity": { "subject_id": "HP:0012432", "subject_label": null, "subject_source": null, - "object_id": "HP:0012450", + "object_id": "HP:0010749", "object_label": null, "object_source": null, "ancestor_id": "HP:0000118", @@ -2059,10 +2059,10 @@ "object_information_content": null, "subject_information_content": null, "ancestor_information_content": 4.118848568918744, - "jaccard_similarity": 0.38461538461538464, + "jaccard_similarity": 0.18518518518518517, "cosine_similarity": null, "dice_similarity": null, - "phenodigm_score": 1.2586391565922337 + "phenodigm_score": 0.8733554459582608 }, "score_metric": "jaccard_similarity" }, diff --git a/frontend/fixtures/phenotype-explorer-search.json b/frontend/fixtures/phenotype-explorer-search.json index 24f49e09f..182c2403b 100644 --- a/frontend/fixtures/phenotype-explorer-search.json +++ b/frontend/fixtures/phenotype-explorer-search.json @@ -73,8 +73,8 @@ } }, "object_termset": { - "HP:0012378": { "id": "HP:0012378", "label": "Fatigue (HPO)" }, - "HP:0002104": { "id": "HP:0002104", "label": "Apnea (HPO)" } + "HP:0002104": { "id": "HP:0002104", "label": "Apnea (HPO)" }, + "HP:0012378": { "id": "HP:0012378", "label": "Fatigue (HPO)" } }, "subject_best_matches": { "ZP:0018569": { @@ -315,8 +315,8 @@ "HP:0002104": { "match_source": "HP:0002104", "match_source_label": "Apnea (HPO)", - "match_target": "ZP:0018568", - "match_target_label": "primitive hemopoiesis absent, abnormal (ZPO)", + "match_target": "ZP:0018569", + "match_target_label": "myeloid cell development absent, abnormal (ZPO)", "score": 9.08524944639702, "match_subsumer": null, "match_subsumer_label": null, @@ -324,7 +324,7 @@ "subject_id": "HP:0002104", "subject_label": null, "subject_source": null, - "object_id": "ZP:0018568", + "object_id": "ZP:0018569", "object_label": null, "object_source": null, "ancestor_id": "UPHENO:0034024", @@ -333,10 +333,10 @@ "object_information_content": null, "subject_information_content": null, "ancestor_information_content": 9.08524944639702, - "jaccard_similarity": 0.3333333333333333, + "jaccard_similarity": 0.34615384615384615, "cosine_similarity": null, "dice_similarity": null, - "phenodigm_score": 1.7402346054863809 + "phenodigm_score": 1.773384910034319 }, "score_metric": "ancestor_information_content" }, @@ -453,8 +453,8 @@ } }, "object_termset": { - "HP:0002104": { "id": "HP:0002104", "label": "Apnea (HPO)" }, - "HP:0012378": { "id": "HP:0012378", "label": "Fatigue (HPO)" } + "HP:0012378": { "id": "HP:0012378", "label": "Fatigue (HPO)" }, + "HP:0002104": { "id": "HP:0002104", "label": "Apnea (HPO)" } }, "subject_best_matches": { "ZP:0018568": { @@ -728,8 +728,8 @@ "HP:0002104": { "match_source": "HP:0002104", "match_source_label": "Apnea (HPO)", - "match_target": "ZP:0018569", - "match_target_label": "myeloid cell development absent, abnormal (ZPO)", + "match_target": "ZP:0018568", + "match_target_label": "primitive hemopoiesis absent, abnormal (ZPO)", "score": 9.08524944639702, "match_subsumer": null, "match_subsumer_label": null, @@ -737,7 +737,7 @@ "subject_id": "HP:0002104", "subject_label": null, "subject_source": null, - "object_id": "ZP:0018569", + "object_id": "ZP:0018568", "object_label": null, "object_source": null, "ancestor_id": "UPHENO:0034024", @@ -746,10 +746,10 @@ "object_information_content": null, "subject_information_content": null, "ancestor_information_content": 9.08524944639702, - "jaccard_similarity": 0.34615384615384615, + "jaccard_similarity": 0.3333333333333333, "cosine_similarity": null, "dice_similarity": null, - "phenodigm_score": 1.773384910034319 + "phenodigm_score": 1.7402346054863809 }, "score_metric": "ancestor_information_content" }, @@ -873,8 +873,8 @@ } }, "object_termset": { - "HP:0012378": { "id": "HP:0012378", "label": "Fatigue (HPO)" }, - "HP:0002104": { "id": "HP:0002104", "label": "Apnea (HPO)" } + "HP:0002104": { "id": "HP:0002104", "label": "Apnea (HPO)" }, + "HP:0012378": { "id": "HP:0012378", "label": "Fatigue (HPO)" } }, "subject_best_matches": { "ZP:0018568": { @@ -966,8 +966,8 @@ "HP:0012378": { "match_source": "HP:0012378", "match_source_label": "Fatigue (HPO)", - "match_target": "ZP:0018568", - "match_target_label": "primitive hemopoiesis absent, abnormal (ZPO)", + "match_target": "ZP:0018569", + "match_target_label": "myeloid cell development absent, abnormal (ZPO)", "score": 1.6836208034928104, "match_subsumer": null, "match_subsumer_label": null, @@ -975,7 +975,7 @@ "subject_id": "HP:0012378", "subject_label": null, "subject_source": null, - "object_id": "ZP:0018568", + "object_id": "ZP:0018569", "object_label": null, "object_source": null, "ancestor_id": "UPHENO:0001005", @@ -984,10 +984,10 @@ "object_information_content": null, "subject_information_content": null, "ancestor_information_content": 1.6836208034928104, - "jaccard_similarity": 0.4444444444444444, + "jaccard_similarity": 0.47058823529411764, "cosine_similarity": null, "dice_similarity": null, - "phenodigm_score": 0.8650294287846346 + "phenodigm_score": 0.8901079388591847 }, "score_metric": "ancestor_information_content" } @@ -1068,13 +1068,13 @@ "score": 5.412148503540145, "similarity": { "subject_termset": { - "ZP:0100294": { - "id": "ZP:0100294", - "label": "visual perception absent, abnormal (ZPO)" - }, "ZP:0000945": { "id": "ZP:0000945", "label": "pigment cell quality, abnormal (ZPO)" + }, + "ZP:0100294": { + "id": "ZP:0100294", + "label": "visual perception absent, abnormal (ZPO)" } }, "object_termset": { @@ -1370,8 +1370,8 @@ "HP:0012378": { "match_source": "HP:0012378", "match_source_label": "Fatigue (HPO)", - "match_target": "ZP:0015039", - "match_target_label": "visual behavior absent, abnormal (ZPO)", + "match_target": "ZP:0001841", + "match_target_label": "visual behavior quality, abnormal (ZPO)", "score": 1.6836208034928104, "match_subsumer": null, "match_subsumer_label": null, @@ -1379,7 +1379,7 @@ "subject_id": "HP:0012378", "subject_label": null, "subject_source": null, - "object_id": "ZP:0015039", + "object_id": "ZP:0001841", "object_label": null, "object_source": null, "ancestor_id": "UPHENO:0001005", @@ -1388,10 +1388,10 @@ "object_information_content": null, "subject_information_content": null, "ancestor_information_content": 1.6836208034928104, - "jaccard_similarity": 0.38095238095238093, + "jaccard_similarity": 0.47058823529411764, "cosine_similarity": null, "dice_similarity": null, - "phenodigm_score": 0.8008616320635836 + "phenodigm_score": 0.8901079388591847 }, "score_metric": "ancestor_information_content" } @@ -1676,8 +1676,8 @@ } }, "object_termset": { - "HP:0002104": { "id": "HP:0002104", "label": "Apnea (HPO)" }, - "HP:0012378": { "id": "HP:0012378", "label": "Fatigue (HPO)" } + "HP:0012378": { "id": "HP:0012378", "label": "Fatigue (HPO)" }, + "HP:0002104": { "id": "HP:0002104", "label": "Apnea (HPO)" } }, "subject_best_matches": { "ZP:0003210": { @@ -1849,8 +1849,8 @@ } }, "object_termset": { - "HP:0002104": { "id": "HP:0002104", "label": "Apnea (HPO)" }, - "HP:0012378": { "id": "HP:0012378", "label": "Fatigue (HPO)" } + "HP:0012378": { "id": "HP:0012378", "label": "Fatigue (HPO)" }, + "HP:0002104": { "id": "HP:0002104", "label": "Apnea (HPO)" } }, "subject_best_matches": { "ZP:0001432": {