Skip to content

Commit

Permalink
Manually change ts model scores to numbers (also updated to latest li…
Browse files Browse the repository at this point in the history
…nkml, but it doesn't have the fix yet)
  • Loading branch information
kevinschaper committed Nov 16, 2023
1 parent cde1104 commit a8d69ae
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 52 deletions.
57 changes: 25 additions & 32 deletions backend/poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ packages = [
python = "^3.9"
pydantic = "^1.10.2"
curies = "<1"
linkml = "^1.6.1"
linkml = "^1.6.2"
prefixmaps = "^0.1.7"

requests = "^2.28.1"
Expand Down
2 changes: 1 addition & 1 deletion backend/tests/fixtures/autocomplete_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
def autocomplete_response():
return {
"responseHeader": {
"QTime": 1,
"QTime": 0,
"params": {
"mm": "100%",
"q": "fanc",
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": 4,
"QTime": 2,
"params": {
"facet.query": [
'object_closure:"HP:0000924"',
Expand Down
10 changes: 5 additions & 5 deletions backend/tests/fixtures/phenotype_explorer_compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,16 @@ def phenotype_explorer_compare():
"HP:0004325": {
"match_source": "HP:0004325",
"match_source_label": "Decreased body weight (HPO)",
"match_target": "MP:0010771",
"match_target_label": "integument phenotype (MPO)",
"match_target": "MP:0002169",
"match_target_label": "no abnormal phenotype detected (MPO)",
"score": 1.4431977534690428,
"match_subsumer": None,
"match_subsumer_label": None,
"similarity": {
"subject_id": "HP:0004325",
"subject_label": None,
"subject_source": None,
"object_id": "MP:0010771",
"object_id": "MP:0002169",
"object_label": None,
"object_source": None,
"ancestor_id": "UPHENO:0001003",
Expand All @@ -87,10 +87,10 @@ def phenotype_explorer_compare():
"object_information_content": None,
"subject_information_content": None,
"ancestor_information_content": 1.4431977534690428,
"jaccard_similarity": 0.3333333333333333,
"jaccard_similarity": 0.16216216216216217,
"cosine_similarity": None,
"dice_similarity": None,
"phenodigm_score": 0.6935891563620457,
"phenodigm_score": 0.48376861011243283,
},
}
},
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": 2,
"QTime": 0,
"params": {
"mm": "100%",
"q": "fanconi",
Expand Down
10 changes: 5 additions & 5 deletions frontend/fixtures/phenotype-explorer-compare.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,16 @@
"HP:0004325": {
"match_source": "HP:0004325",
"match_source_label": "Decreased body weight (HPO)",
"match_target": "MP:0010771",
"match_target_label": "integument phenotype (MPO)",
"match_target": "MP:0002169",
"match_target_label": "no abnormal phenotype detected (MPO)",
"score": 1.4431977534690428,
"match_subsumer": null,
"match_subsumer_label": null,
"similarity": {
"subject_id": "HP:0004325",
"subject_label": null,
"subject_source": null,
"object_id": "MP:0010771",
"object_id": "MP:0002169",
"object_label": null,
"object_source": null,
"ancestor_id": "UPHENO:0001003",
Expand All @@ -93,10 +93,10 @@
"object_information_content": null,
"subject_information_content": null,
"ancestor_information_content": 1.4431977534690428,
"jaccard_similarity": 0.3333333333333333,
"jaccard_similarity": 0.16216216216216217,
"cosine_similarity": null,
"dice_similarity": null,
"phenodigm_score": 0.6935891563620457
"phenodigm_score": 0.48376861011243283
}
}
},
Expand Down
12 changes: 6 additions & 6 deletions frontend/src/api/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -519,18 +519,18 @@ export interface TermPairwiseSimilarity extends PairwiseSimilarity {
ancestor_label?: string,
ancestor_source?: string,
/** The IC of the object */
object_information_content?: string,
object_information_content?: number,
/** The IC of the subject */
subject_information_content?: string,
subject_information_content?: number,
/** The IC of the object */
ancestor_information_content?: string,
ancestor_information_content?: number,
/** The number of concepts in the intersection divided by the number in the union */
jaccard_similarity?: string,
jaccard_similarity?: number,
/** the dot product of two node embeddings divided by the product of their lengths */
cosine_similarity?: number,
dice_similarity?: string,
dice_similarity?: number,
/** the geometric mean of the jaccard similarity and the information content */
phenodigm_score?: string,
phenodigm_score?: number,
};
/**
* A simple pairwise similarity between two sets of concepts/terms
Expand Down

0 comments on commit a8d69ae

Please sign in to comment.