Skip to content

Commit

Permalink
Add Resources (Bang Our Own Drum) (#463)
Browse files Browse the repository at this point in the history
Addresses #348 

- [x] Adds resources page and endpoint to router
- [x] Adds some icons
- [x] Need to figure out icons for ones that don't have one (maybe
@vincerubinetti will have ideas) ((Mondo should get a textless version
eventually, i just don't have illustrator))
  • Loading branch information
glass-ships authored Nov 21, 2023
1 parent dc1cf77 commit 6d0346e
Show file tree
Hide file tree
Showing 23 changed files with 748 additions and 20 deletions.
19 changes: 14 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ install-frontend:
model: install-backend
$(RUN) gen-pydantic $(SCHEMADIR)/model.yaml > $(SCHEMADIR)/model.py
$(RUN) gen-typescript $(SCHEMADIR)/model.yaml > frontend/src/api/model.ts
$(RUN) black $(SCHEMADIR)/model.py
make format


### Documentation ###
Expand Down Expand Up @@ -111,11 +111,20 @@ test-frontend:

.PHONY: fixtures
fixtures:
@echo "Generating fixtures..."
@echo "Generating fixtures and data..."
$(RUN) python scripts/generate_fixtures.py --all-fixtures
$(RUN) black -l 120 backend/tests/fixtures/
cd frontend && \
yarn lint
make format


.PHONY: data
data:
@echo "Generating frontpage metadata..."
$(RUN) python scripts/generate_fixtures.py --metadata
@echo "Generating publications data..."
$(RUN) python scripts/get_publications.py
@echo "Generating resources data..."
wget https://raw.githubusercontent.com/monarch-initiative/monarch-documentation/main/src/docs/resources/monarch-app-resources.json -O frontend/src/pages/resources/resources.json
make format-frontend

### Development ###

Expand Down
2 changes: 1 addition & 1 deletion backend/tests/fixtures/association_counts_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
def association_counts_response():
return {
"responseHeader": {
"QTime": 2,
"QTime": 3,
"params": {
"facet.query": [
'(category:"biolink:DiseaseToPhenotypicFeatureAssociation") AND (subject:"MONDO:0020121" OR subject_closure:"MONDO:0020121")',
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": 4,
"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:0002169",
"match_target_label": "no abnormal phenotype detected (MPO)",
"match_target": "MP:0010771",
"match_target_label": "integument phenotype (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:0002169",
"object_id": "MP:0010771",
"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.16216216216216217,
"jaccard_similarity": 0.3333333333333333,
"cosine_similarity": None,
"dice_similarity": None,
"phenodigm_score": 0.48376861011243283,
"phenodigm_score": 0.6935891563620457,
},
}
},
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
19 changes: 19 additions & 0 deletions frontend/fixtures/association-counts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"items": [
{
"label": "Phenotypes",
"count": 4027,
"category": "biolink:DiseaseToPhenotypicFeatureAssociation"
},
{
"label": "Causal Genes",
"count": 124,
"category": "biolink:CausalGeneToDiseaseAssociation"
},
{
"label": "Correlated Genes",
"count": 151,
"category": "biolink:CorrelatedGeneToDiseaseAssociation"
}
]
}
15 changes: 15 additions & 0 deletions frontend/fixtures/entity.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"id": "MONDO:0020121",
"category": "biolink:Disease",
"name": "muscular dystrophy",
"full_name": null,
"deprecated": null,
"description": "Muscular dystrophy (MD) refers to a group of more than 30 genetic diseases characterized by progressive weakness and degeneration of the skeletal muscles that control movement. Some forms of MD are seen in newborns, infants or children, while others have late-onset and may not appear until middle age or later. The disorders differ in terms of the distribution and extent of muscle weakness (some forms of MD also affect cardiac muscle), age of onset, rate of progression, and pattern of inheritance. The prognosis for people with MD varies according to the type and progression of the disorder. There is no specific treatment to stop or reverse any form of MD. Treatment is supportive and may include physical therapy, respiratory therapy, speech therapy, orthopedic appliances used for support, corrective orthopedic surgery, and medicationsincluding corticosteroids, anticonvulsants (seizure medications), immunosuppressants, and antibiotics. Some individuals may need assisted ventilation to treat respiratory muscle weaknessor a pacemaker for cardiac (heart)abnormalities.",
"xref": [],
"provided_by": "phenio_nodes",
"in_taxon": null,
"in_taxon_label": null,
"symbol": null,
"synonym": [],
"uri": "http://purl.obolibrary.org/obo/MONDO_0020121"
}
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:0002169",
"match_target_label": "no abnormal phenotype detected (MPO)",
"match_target": "MP:0010771",
"match_target_label": "integument phenotype (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:0002169",
"object_id": "MP:0010771",
"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.16216216216216217,
"jaccard_similarity": 0.3333333333333333,
"cosine_similarity": null,
"dice_similarity": null,
"phenodigm_score": 0.48376861011243283
"phenodigm_score": 0.6935891563620457
}
}
},
Expand Down
22 changes: 22 additions & 0 deletions frontend/src/assets/icons/resource-exomiser.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 44 additions & 0 deletions frontend/src/assets/icons/resource-hpo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions frontend/src/assets/icons/resource-linkml.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 50 additions & 0 deletions frontend/src/assets/icons/resource-monarch.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions frontend/src/assets/icons/resource-mondo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 6d0346e

Please sign in to comment.