Skip to content

Commit

Permalink
CTD,biolink/monarch,ebi-proteins,litvar: adjust nunjucks templating used
Browse files Browse the repository at this point in the history
reference: biothings/call-apis.js#30
due to code on some instances keeping the ID prefix from the TRAPI query
  • Loading branch information
colleenXu committed Mar 18, 2023
1 parent da81308 commit 7b918f8
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 28 deletions.
22 changes: 11 additions & 11 deletions CTD/smartapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ components:
semantic: SmallMolecule
parameters:
inputType: gene
inputTerms: "{{ queryInputs }}" ## no prefix
inputTerms: "{{ queryInputs | rmPrefix() }}" ## no prefix
inputTermSearchType: directAssociations
report: chems_curated
format: json
Expand Down Expand Up @@ -240,7 +240,7 @@ components:
semantic: SmallMolecule
parameters:
inputType: disease
inputTerms: "{{ queryInputs | addPrefix('MESH') }}" ## HAS PREFIX
inputTerms: "{{ queryInputs | replPrefix('MESH') }}" ## HAS PREFIX
inputTermSearchType: directAssociations
report: chems_curated
format: json
Expand Down Expand Up @@ -282,7 +282,7 @@ components:
semantic: SmallMolecule
parameters:
inputType: disease
inputTerms: "{{ queryInputs | addPrefix('OMIM') }}" ## HAS PREFIX
inputTerms: "{{ queryInputs | replPrefix('OMIM') }}" ## HAS PREFIX
inputTermSearchType: directAssociations
report: chems_curated
format: json
Expand Down Expand Up @@ -376,7 +376,7 @@ components:
semantic: Gene
parameters:
inputType: disease
inputTerms: "{{ queryInputs | addPrefix('MESH') }}" ## HAS PREFIX
inputTerms: "{{ queryInputs | replPrefix('MESH') }}" ## HAS PREFIX
inputTermSearchType: directAssociations
report: genes_curated
format: json
Expand All @@ -397,7 +397,7 @@ components:
# semantic: Disease
# parameters:
# inputType: gene
# inputTerms: "{{ queryInputs }}" ## no prefix
# inputTerms: "{{ queryInputs | rmPrefix() }}" ## no prefix
# inputTermSearchType: directAssociations
# report: diseases_curated
# format: json
Expand All @@ -418,7 +418,7 @@ components:
semantic: Gene
parameters:
inputType: disease
inputTerms: "{{ queryInputs | addPrefix('OMIM') }}" ## HAS PREFIX
inputTerms: "{{ queryInputs | replPrefix('OMIM') }}" ## HAS PREFIX
inputTermSearchType: directAssociations
report: genes_curated
format: json
Expand All @@ -439,7 +439,7 @@ components:
# semantic: Disease
# parameters:
# inputType: gene
# inputTerms: "{{ queryInputs }}" ## no prefix
# inputTerms: "{{ queryInputs | rmPrefix() }}" ## no prefix
# inputTermSearchType: directAssociations
# report: diseases_curated
# format: json
Expand All @@ -461,7 +461,7 @@ components:
# semantic: Pathway
# parameters:
# inputType: gene
# inputTerms: "{{ queryInputs }}" ## no prefix
# inputTerms: "{{ queryInputs | rmPrefix() }}" ## no prefix
# inputTermSearchType: directAssociations
# report: pathways_curated
# format: json
Expand All @@ -482,7 +482,7 @@ components:
semantic: Gene
parameters:
inputType: pathway
inputTerms: "{{ queryInputs | addPrefix('REACT') }}" ## HAS PREFIX
inputTerms: "{{ queryInputs | replPrefix('REACT') }}" ## HAS PREFIX
inputTermSearchType: directAssociations
report: genes_curated
format: json
Expand All @@ -503,7 +503,7 @@ components:
# semantic: Pathway
# parameters:
# inputType: gene
# inputTerms: "{{ queryInputs }}" ## no prefix
# inputTerms: "{{ queryInputs | rmPrefix() }}" ## no prefix
# inputTermSearchType: directAssociations
# report: pathways_curated
# format: json
Expand All @@ -524,7 +524,7 @@ components:
semantic: Gene
parameters:
inputType: pathway
inputTerms: "{{ queryInputs | addPrefix('KEGG') }}" ## HAS PREFIX (not biolink-model spelling)
inputTerms: "{{ queryInputs | replPrefix('KEGG') }}" ## HAS PREFIX (not biolink-model spelling)
inputTermSearchType: directAssociations
report: genes_curated
format: json
Expand Down
27 changes: 14 additions & 13 deletions biolink/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1111,7 +1111,7 @@ components:
- id: HGNC ## Monarch seems to prefer HGNC IDs for human genes
semantic: Gene
parameters:
id: "{{ queryInputs | addPrefix('HGNC') }}"
id: "{{ queryInputs | replPrefix('HGNC') }}"
## add prefix since Monarch expects this, while BTE automatically removes
rows: -1
direct: true
Expand All @@ -1136,7 +1136,7 @@ components:
- id: HGNC
semantic: Gene
parameters:
id: "{{ queryInputs | addPrefix('HGNC') }}"
id: "{{ queryInputs | replPrefix('HGNC') }}"
## add prefix since Monarch expects this, while BTE automatically removes
rows: -1
direct: true
Expand All @@ -1162,7 +1162,7 @@ components:
- id: HGNC
semantic: Gene
parameters:
id: "{{ queryInputs | addPrefix('HGNC') }}"
id: "{{ queryInputs | replPrefix('HGNC') }}"
## add prefix since Monarch expects this, while BTE automatically removes
rows: -1
direct: true
Expand All @@ -1187,7 +1187,7 @@ components:
- id: HGNC
semantic: Gene
parameters:
id: "{{ queryInputs | addPrefix('HGNC') }}"
id: "{{ queryInputs | replPrefix('HGNC') }}"
rows: -1
direct: true
unselect_evidence: true
Expand Down Expand Up @@ -1219,7 +1219,7 @@ components:
- id: HGNC
semantic: Gene ## aka start with human gene
parameters:
id: "{{ queryInputs | addPrefix('HGNC') }}"
id: "{{ queryInputs | replPrefix('HGNC') }}"
## add prefix since Monarch expects this, while BTE automatically removes
rows: -1
direct: true
Expand Down Expand Up @@ -1249,7 +1249,7 @@ components:
- id: HGNC
semantic: Gene ## aka start with human gene
parameters:
id: "{{ queryInputs | addPrefix('HGNC') }}"
id: "{{ queryInputs | replPrefix('HGNC') }}"
## add prefix since Monarch expects this, while BTE automatically removes
rows: -1
direct: true
Expand Down Expand Up @@ -1277,7 +1277,7 @@ components:
- id: HGNC
semantic: Gene
parameters:
id: "{{ queryInputs | addPrefix('HGNC') }}"
id: "{{ queryInputs | replPrefix('HGNC') }}"
rows: -1
direct: true
unselect_evidence: true
Expand All @@ -1301,7 +1301,7 @@ components:
- id: HGNC
semantic: Gene
parameters:
id: "{{ queryInputs | addPrefix('HGNC') }}"
id: "{{ queryInputs | replPrefix('HGNC') }}"
rows: -1
direct: true
unselect_evidence: true
Expand All @@ -1324,7 +1324,7 @@ components:
- id: REACT
semantic: Pathway
parameters:
id: "{{ queryInputs | addPrefix('REACT') }}"
id: "{{ queryInputs | replPrefix('REACT') }}"
## add prefix since Monarch expects this, while BTE automatically removes
rows: -1
direct: true
Expand Down Expand Up @@ -1423,7 +1423,7 @@ components:
- id: DBSNP
semantic: SequenceVariant
parameters:
id: "{{ queryInputs | addPrefix('dbSNP') }}"
id: "{{ queryInputs | replPrefix('dbSNP') }}"
## add prefix since Monarch expects this in this form, while BTE automatically removes
rows: -1
direct: true
Expand All @@ -1450,7 +1450,7 @@ components:
- id: DBSNP
semantic: SequenceVariant
parameters:
id: "{{ queryInputs | addPrefix('dbSNP') }}"
id: "{{ queryInputs | replPrefix('dbSNP') }}"
# id: "dbSNP:{inputs[0]}"
## add prefix since Monarch expects this in this form, while BTE automatically removes
rows: -1
Expand All @@ -1475,7 +1475,7 @@ components:
- id: DBSNP
semantic: SequenceVariant
parameters:
id: "{{ queryInputs | addPrefix('dbSNP') }}"
id: "{{ queryInputs | replPrefix('dbSNP') }}"
## add prefix since Monarch expects this in this form, while BTE automatically removes
rows: -1
direct: true
Expand All @@ -1492,4 +1492,5 @@ components:
# testExamples:
# - qInput: "DBSNP:rs115165302"
# oneOutput: "HP:0002944" ## Thoracolumbar scoliosis
## another possible input: "DBSNP:rs771684665"
## another possible input: "DBSNP:rs771684665"

2 changes: 1 addition & 1 deletion ebi_proteins/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3248,7 +3248,7 @@ components:
- id: UniProtKB
semantic: Gene
parameters:
accession: "{{ queryInputs }}" ## no prefix
accession: "{{ queryInputs | rmPrefix() }}" ## no prefix
outputs:
- id: RHEA
semantic: MolecularActivity
Expand Down
2 changes: 1 addition & 1 deletion litvar/smartapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ components:
- id: DBSNP
semantic: SequenceVariant
parameters:
variantid: "{{ queryInputs }}%23%23" ## no prefix
variantid: "{{ queryInputs | rmPrefix() }}%23%23" ## no prefix
outputs:
- id: NCBIGene
semantic: Gene
Expand Down
4 changes: 2 additions & 2 deletions ols/smartapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ components:
response_mapping:
"$ref": "#/components/x-bte-response-mapping/disease_has_subclass_disease"
# testExamples:
# - qInput: "DOID:0050686" ## organ system cancer
# oneOutput: "DOID:1725" ## peritoneum cancer
# - qInput: "DOID:10123" ## skin pigmentation disorder
# oneOutput: "MONDO:0007483" ## dyschromatosis symmetrica hereditaria
x-bte-response-mapping:
disease_has_subclass_disease:
DOID: _embedded.terms.obo_id ## HAS PREFIX (DOID)

0 comments on commit 7b918f8

Please sign in to comment.