Skip to content

Commit

Permalink
complexportal: add smartapi yaml with x-bte annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
colleenXu committed Dec 13, 2023
1 parent 36e9975 commit c4b1a6c
Showing 1 changed file with 207 additions and 0 deletions.
207 changes: 207 additions & 0 deletions complexportal/smartapi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
openapi: 3.0.3
info:
version: '1.0'
title: Complex Portal Web Service
description: >-
The Complex Portal is a manually curated, encyclopaedic resource of macromolecular complexes
from a number of key model organisms. The majority of complexes are made up of proteins
but may also include nucleic acids or small molecules.
termsOfService: https://www.ebi.ac.uk/complexportal/about#license_privacy
contact:
name: EMBL-EBI form for support and feedback
url: https://www.ebi.ac.uk/about/contact/support/complexportal
x-translator:
infores: "infores:complex-portal"
component: KP
team:
- Service Provider
biolink-version: "3.5.3"
servers:
- url: https://www.ebi.ac.uk/intact/complex-ws
description: Production server
x-maturity: production
tags:
- name: translator
paths:
"/search/{search_term}":
get:
description: search for complexes matching your search term
parameters:
- name: search_term
in: path
description: >-
can be a ID (ex: for a protein, chemical, or disease) or a complex name
required: true
example: P69905
schema:
type: string
responses:
'200':
description: response object
content:
application/json:
schema:
type: object
x-bte-kgs-operations:
- "$ref": "#/components/x-bte-kgs-operations/protein2complex"
- "$ref": "#/components/x-bte-kgs-operations/chemical2complex"
- "$ref": "#/components/x-bte-kgs-operations/disease2complex"
"/complex/{id}":
get:
description: retrieve full complex info using the ComplexPortal ID
parameters:
- name: id
in: path
description: ComplexPortal ID for the complex
required: true
example: CPX-2158
schema:
type: string
responses:
'200':
description: response object
content:
application/json:
schema:
type: object
## Complex -> entity x-bte operations use JQ post-processing
# x-bte-kgs-operations:
# - "$ref": "#/components/x-bte-kgs-operations/complex2protein"
# - "$ref": "#/components/x-bte-kgs-operations/complex2chemical"
# - "$ref": "#/components/x-bte-kgs-operations/complex2disease"
components:
x-bte-kgs-operations:
protein2complex:
- supportBatch: false
useTemplating: true
inputs:
- id: UniProtKB
semantic: Protein
outputs:
- id: ComplexPortal
semantic: MacromolecularComplex
parameters:
search_term: "{{ queryInputs }}" ## no prefix
predicate: part_of
response_mapping:
"$ref": "#/components/x-bte-response-mapping/complex-output"
# testExamples:
# - qInput: "UniProtKB:P69905" ## Hemoglobin subunit alpha
# oneOutput: "ComplexPortal:CPX-2158" ## Hemoglobin HbA complex
chemical2complex:
- supportBatch: false
useTemplating: true
inputs:
- id: CHEBI
semantic: SmallMolecule
outputs:
- id: ComplexPortal
semantic: MacromolecularComplex
parameters:
search_term: "{{ queryInputs | replPrefix('CHEBI') }}" ## requires prefix
predicate: part_of
response_mapping:
"$ref": "#/components/x-bte-response-mapping/complex-output"
# testExamples:
# - qInput: "CHEBI:30413" ## heme
# oneOutput: "ComplexPortal:CPX-2158" ## Hemoglobin HbA complex
disease2complex:
- supportBatch: false
useTemplating: true
inputs:
- id: ORPHANET
semantic: Disease
outputs:
- id: ComplexPortal
semantic: MacromolecularComplex
parameters:
search_term: "{{ queryInputs | replPrefix('Orphanet') }}" ## requires prefix
predicate: related_to
## "complex is linked to a specific disease condition" according to
## https://www.ebi.ac.uk/complexportal/documentation
response_mapping:
"$ref": "#/components/x-bte-response-mapping/complex-output"
# testExamples:
# - qInput: "ORPHANET:848" ## Beta-thalassemia
# oneOutput: "ComplexPortal:CPX-2158" ## Hemoglobin HbA complex
## Complex -> entity x-bte operations use JQ post-processing
# complex2protein:
# - supportBatch: false
# useTemplating: true
# inputs:
# - id: ComplexPortal
# semantic: MacromolecularComplex
# outputs:
# - id: UniProtKB
# semantic: Protein
# parameters:
# id: "{{ queryInputs }}" ## no prefix
# predicate: has_part
# transformer:
# wrap_jq: |
# .participants |= map(if (.identifier | contains(":") | not) then . else empty end)
# response_mapping:
# "$ref": "#/components/x-bte-response-mapping/complex2protein"
# # testExamples:
# # - qInput: "ComplexPortal:CPX-2158" ## Hemoglobin HbA complex
# # oneOutput: "UniProtKB:P69905" ## Hemoglobin subunit alpha
# complex2chemical:
# - supportBatch: false
# useTemplating: true
# inputs:
# - id: ComplexPortal
# semantic: MacromolecularComplex
# outputs:
# - id: CHEBI
# semantic: SmallMolecule
# parameters:
# id: "{{ queryInputs }}" ## no prefix
# predicate: has_part
# transformer:
# wrap_jq: |
# .participants |= map(if (.identifier | contains(":")) then .identifier = (.identifier | split(":") | last) else empty end)
# response_mapping:
# "$ref": "#/components/x-bte-response-mapping/complex2chemical"
# # testExamples:
# # - qInput: "ComplexPortal:CPX-2158" ## Hemoglobin HbA complex
# # oneOutput: "CHEBI:30413" ## heme
# complex2disease:
# - supportBatch: false
# useTemplating: true
# inputs:
# - id: ComplexPortal
# semantic: MacromolecularComplex
# outputs:
# - id: ORPHANET
# semantic: Disease
# parameters:
# id: "{{ queryInputs }}" ## no prefix
# predicate: related_to
# ## "complex is linked to a specific disease condition" according to
# ## https://www.ebi.ac.uk/complexportal/documentation
# transformer:
# wrap_jq: |
# # matches [non_space_text] in disease text and removes prefix
# .disease_ids = (.diseases | map([ . | match("\\[(\\S*)\\]"; "g") | .captures | .[0] | .string | split(":") | last ]) | flatten)
# response_mapping:
# "$ref": "#/components/x-bte-response-mapping/complex2disease"
# # testExamples:
# # - qInput: "ComplexPortal:CPX-2158" ## Hemoglobin HbA complex
# # oneOutput: "ORPHANET:848" ## Beta-thalassemia
x-bte-response-mapping:
complex-output:
ComplexPortal: elements.complexAC
output_name: elements.complexName
## other fields:
## - organismName (not in biolink-model format)
## - description: for the complex, not the relationship...
complex2protein:
## this is after JQ-post-processing
UniProtKB: participants.identifier
complex2chemical:
## this is after JQ-post-processing
CHEBI: participants.identifier
complex2disease:
## this is a field made with JQ-post-processing
ORPHANET: disease_ids

1 comment on commit c4b1a6c

@colleenXu
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Credit to @rjawesome for writing the initial draft biothings/biothings_explorer#631 (comment). I made minor edits and notes

Please sign in to comment.