Closed gglusman closed 8 months ago
@colleenXu @gglusman API https://biothings.ncats.io/multiomics_wellness_kp updated to version 1.7
Putting an example of the x-bte annotation adjustments here...
After looking at the diagram of what's in the KP, I've picked the MetaEdge: ClinicalFinding (LOINC) -(correlated_with)-> SmallMolecule (HMDB)
to work on as my example.
Note: a issue was uncovered during this process, where records that differ only by their edge-attributes (aka associations from analyzing different cohorts) aren't being all returned by BTE. I'll raise this as an issue for BTE to fix.
Reviewing @gglusman's TRAPI 1.4 yaml:
info.version
: value needs to be a string (quotation marks '1.7'
). Shows as an error when document is pasted into the SmartAPI Editorinfo.x-translator.biolink-version
: can update to the version of biolink-model BTE is using, which is 3.1.1
x-bte-kgs-operations
section(unless otherwise specified, the points apply to all operations)
A. inputs
and outputs
are one-element arrays (yes, I know it's illogical). Here's what UniProtKB-CAS
's should look like:
inputs:
- id: UniProtKB
semantic: Protein
outputs:
- id: CAS
semantic: SmallMolecule
B. as shown above, the outputs
should be changed to what the object will be.
UniProtKB-CAS
, that is id: CAS
and semantic: SmallMolecule
- which is our stand-in category for any chemical identifier (BTE will handle any discrepancies with what SRI Node Normalizer returns)UniProtKB-CAS-Rev
, that is id: UniProtKB
and semantic: Protein
(we're querying the API data from its object field -> retrieving its subject field).C. for "-Rev" operations only: the requestBody.body
scopes section and parameters.fields
should be adjusted to query the API data from its object field -> retrieving its subject field. For UniProtKB-CAS-Rev
, it would look like this:
requestBody:
body: >-
{"q": [ {{ queryInputs | replPrefix('CAS') | wrap( '["', '","biolink:Protein"]' ) }} ],
"scopes": ["object.CAS", "subject.type"]}
parameters:
fields: >-
subject.UniProtKB,
association.attributes,
association.sources,
subject.name,
object.name
D. as shown above, from the parameter.fields
, remove the ## TRAPI 1.4
. Because this is a wrapped text block, the comment will be parsed as text rather than ignored...
E. the response_mapping
should correspond with the outputs
and what field of the response that corresponds to.
UniProtKB-CAS
, that should be $ref: '#/components/x-bte-response-mapping/CAS'
. UniProtKB-CAS-Rev
, that should be $ref: '#/components/x-bte-response-mapping/UniProtKB-rev'
F. For PUBCHEM.COMPOUND AND KEGG.COMPOUND: these prefixes are spelled this way in the API data and in the biolink-model specification. However, you are correct in having no periods in the operation and response-mapping names. So...I suggest the following replacements to fix the handling of these prefixes:
id: PUBCHEM_COMPOUND
-> id: PUBCHEM.COMPOUND
id: KEGG_COMPOUND
-> id: KEGG.COMPOUND
replPrefix('PUBCHEM_COMPOUND')
-> replPrefix('PUBCHEM.COMPOUND')
replPrefix('KEGG_COMPOUND')
-> replPrefix('KEGG.COMPOUND')
x-bte-response-mapping
sectionFor all objects, replace edge_attributes
-> edge-attributes
. I know it's not the same format as other keywords like trapi_sources
, input_name
, output_name
...oops >.<...
@gglusman and completely optional extras...
@colleenXu All done, I think!
@gglusman
Yes, it looks good except for 1 thing! https://github.com/Hadlock-Lab/multiomics_wellness_kp/commit/ad5dc9d89711158ab280662bd3880cb6d4b45b4b#r121229603
I can see how my wording above is confusing >.<.
The info.x-translator.infores
line is needed, and my earlier comments were meant to mean "I use double-quotations around strings with characters like periods or colons, out of an abundance of caution. It's not necessary because everything seems to be parsed fine by all tools involved, so this is just an FYI".
This issue seems to have been addressed: