opentox api introductory presentation
DESCRIPTION
Introduction to the OpenTox API, its underlying priciples and its capabilities.TRANSCRIPT
![Page 1: OpenTox API introductory presentation](https://reader033.vdocument.in/reader033/viewer/2022042715/559c455a1a28ab9a218b45d6/html5/thumbnails/1.jpg)
OpenTox REST API [A brief overview]
P. Sopasakis 1 National Technical University of Athens, Greece, 2 IMT Institute for Advanced Studies Lucca, Italy.
![Page 2: OpenTox API introductory presentation](https://reader033.vdocument.in/reader033/viewer/2022042715/559c455a1a28ab9a218b45d6/html5/thumbnails/2.jpg)
Part I The OpenTox framework [design principles] [components] [access control]
![Page 3: OpenTox API introductory presentation](https://reader033.vdocument.in/reader033/viewer/2022042715/559c455a1a28ab9a218b45d6/html5/thumbnails/3.jpg)
Design principles ¡ REST architecture
![Page 4: OpenTox API introductory presentation](https://reader033.vdocument.in/reader033/viewer/2022042715/559c455a1a28ab9a218b45d6/html5/thumbnails/4.jpg)
Design principles ¡ REST architecture – methods
• GET: read • POST: create • PUT: update • DELETE: delete
![Page 5: OpenTox API introductory presentation](https://reader033.vdocument.in/reader033/viewer/2022042715/559c455a1a28ab9a218b45d6/html5/thumbnails/5.jpg)
Design principles ¡ Linked data (RDF framework & Web ontologies)
![Page 6: OpenTox API introductory presentation](https://reader033.vdocument.in/reader033/viewer/2022042715/559c455a1a28ab9a218b45d6/html5/thumbnails/6.jpg)
Main components
Compound/Conformer Dataset
Algorithm
Validation report
Feature
Model
Model validation
Asynchronous task
Error report
![Page 7: OpenTox API introductory presentation](https://reader033.vdocument.in/reader033/viewer/2022042715/559c455a1a28ab9a218b45d6/html5/thumbnails/7.jpg)
Access control
![Page 8: OpenTox API introductory presentation](https://reader033.vdocument.in/reader033/viewer/2022042715/559c455a1a28ab9a218b45d6/html5/thumbnails/8.jpg)
Access policies
![Page 9: OpenTox API introductory presentation](https://reader033.vdocument.in/reader033/viewer/2022042715/559c455a1a28ab9a218b45d6/html5/thumbnails/9.jpg)
Part II The OpenTox API [with cURL examples]
![Page 10: OpenTox API introductory presentation](https://reader033.vdocument.in/reader033/viewer/2022042715/559c455a1a28ab9a218b45d6/html5/thumbnails/10.jpg)
Features
![Page 11: OpenTox API introductory presentation](https://reader033.vdocument.in/reader033/viewer/2022042715/559c455a1a28ab9a218b45d6/html5/thumbnails/11.jpg)
Features
![Page 12: OpenTox API introductory presentation](https://reader033.vdocument.in/reader033/viewer/2022042715/559c455a1a28ab9a218b45d6/html5/thumbnails/12.jpg)
Features
Request:!curl -X POST --data-binary @myfeature.rdf!http://apps.ideaconsult.net:8080/ambit2/feature!-H Content-type:application/rdf+xml!
![Page 13: OpenTox API introductory presentation](https://reader033.vdocument.in/reader033/viewer/2022042715/559c455a1a28ab9a218b45d6/html5/thumbnails/13.jpg)
Features
Request:!curl -X POST --data-binary @myfeature.rdf!http://apps.ideaconsult.net:8080/ambit2/feature!-H Content-type:application/rdf+xml!
Response:!http://apps.ideaconsult.net:8080/ambit2/feature/10242786!
![Page 14: OpenTox API introductory presentation](https://reader033.vdocument.in/reader033/viewer/2022042715/559c455a1a28ab9a218b45d6/html5/thumbnails/14.jpg)
Compounds/conformers
![Page 15: OpenTox API introductory presentation](https://reader033.vdocument.in/reader033/viewer/2022042715/559c455a1a28ab9a218b45d6/html5/thumbnails/15.jpg)
Compounds/conformers
Request:!curl -H Accept:chemical/x-daylight-smiles !http://apps.ideaconsult.net:8080/ambit2/compound/101 -v!
Request according to the API
![Page 16: OpenTox API introductory presentation](https://reader033.vdocument.in/reader033/viewer/2022042715/559c455a1a28ab9a218b45d6/html5/thumbnails/16.jpg)
Compounds/conformers
Request:!curl -H Accept:chemical/x-daylight-smiles !http://apps.ideaconsult.net:8080/ambit2/compound/101 -v!
Response:!< HTTP/1.1 200 OK!< Date: Mon, 15 Sep 2014 17:34:48 GMT!...!< Server: Restlet-Framework/2.0m6!< Content-Type: chemical/x-daylight-smiles;charset=UTF-8!< Transfer-Encoding: chunked!< !NC(C)Cc1ccccc1.NC(C)Cc1ccccc1.O=S(=O)(O)O!
Response according to the API
![Page 17: OpenTox API introductory presentation](https://reader033.vdocument.in/reader033/viewer/2022042715/559c455a1a28ab9a218b45d6/html5/thumbnails/17.jpg)
Compounds/conformers Loop up for furosemide:
Request:!curl -H Accept:text/uri-list /ambit/compound?search=furosemide&pagesize=1!
Response:!/ambit/compound/148/conformer/143983!
![Page 18: OpenTox API introductory presentation](https://reader033.vdocument.in/reader033/viewer/2022042715/559c455a1a28ab9a218b45d6/html5/thumbnails/18.jpg)
Compounds/conformers Now ask for the value of logD for this compound:
Request:!curl -H Accept:application/json "http://apps.ideaconsult.net:8080/ambit2/compound/184?feature_uris%5B%5D=http%3A%2F%2Fapps.ideaconsult.net%3A8080%2Fambit2%2Ffeature%2F22204"!
Request:!curl -H Accept:text/uri-list /ambit/compound?search=furosemide&pagesize=1!
Response:!/ambit/compound/148/conformer/143983!
![Page 19: OpenTox API introductory presentation](https://reader033.vdocument.in/reader033/viewer/2022042715/559c455a1a28ab9a218b45d6/html5/thumbnails/19.jpg)
Compounds/conformers Now ask for the value of logD for this compound:
Request:!curl -H Accept:application/json "http://apps.ideaconsult.net:8080/ambit2/compound/184?feature_uris%5B%5D=http%3A%2F%2Fapps.ideaconsult.net%3A8080%2Fambit2%2Ffeature%2F22204"! Response:
"dataEntry":[ { "compound":{ "URI":"/ambit2/compound/184", }, "values":{ "/ambit2/feature/22204":-1.210 }!
which returns the requested value:
Request:!curl -H Accept:text/uri-list /ambit/compound?search=furosemide&pagesize=1!
Response:!/ambit/compound/148/conformer/143983!
![Page 20: OpenTox API introductory presentation](https://reader033.vdocument.in/reader033/viewer/2022042715/559c455a1a28ab9a218b45d6/html5/thumbnails/20.jpg)
Datasets [API specs]
¡ GET: ¡ Download in RDF, JSON, CSV, ARFF or other formats, or get a
single feature-value pair for a compound, ¡ Query a dataset, select compounds or features ¡ Get metadata of the dataset
¡ POST: ¡ Create a new dataset on the server,
¡ PUT: ¡ Update the dataset
¡ DELETE: ¡ Delete a dataset, ¡ Delete part of a dataset (some compounds and/or features)
![Page 21: OpenTox API introductory presentation](https://reader033.vdocument.in/reader033/viewer/2022042715/559c455a1a28ab9a218b45d6/html5/thumbnails/21.jpg)
Datasets [RDF representation]
* this structure is determined and understood by the OpenTox ontology.
![Page 22: OpenTox API introductory presentation](https://reader033.vdocument.in/reader033/viewer/2022042715/559c455a1a28ab9a218b45d6/html5/thumbnails/22.jpg)
Algorithms
![Page 23: OpenTox API introductory presentation](https://reader033.vdocument.in/reader033/viewer/2022042715/559c455a1a28ab9a218b45d6/html5/thumbnails/23.jpg)
Algorithms
username=guest!password=guest!
![Page 24: OpenTox API introductory presentation](https://reader033.vdocument.in/reader033/viewer/2022042715/559c455a1a28ab9a218b45d6/html5/thumbnails/24.jpg)
Algorithms
token=`curl -X POST -k 'https://opensso.in-silico.ch:443/auth/authenticate?uri=service=openldap' -d username=$username -d password=$password 2> /dev/null`!token=`echo $token | cut -c10-80`;!
username=guest!password=guest!
![Page 25: OpenTox API introductory presentation](https://reader033.vdocument.in/reader033/viewer/2022042715/559c455a1a28ab9a218b45d6/html5/thumbnails/25.jpg)
Algorithms
token=`curl -X POST -k 'https://opensso.in-silico.ch:443/auth/authenticate?uri=service=openldap' -d username=$username -d password=$password 2> /dev/null`!token=`echo $token | cut -c10-80`;!
username=guest!password=guest!
![Page 26: OpenTox API introductory presentation](https://reader033.vdocument.in/reader033/viewer/2022042715/559c455a1a28ab9a218b45d6/html5/thumbnails/26.jpg)
Algorithms
token=`curl -X POST -k 'https://opensso.in-silico.ch:443/auth/authenticate?uri=service=openldap' -d username=$username -d password=$password 2> /dev/null`!token=`echo $token | cut -c10-80`;!
username=guest!password=guest!
task_uri=`curl -X POST http://opentox.ntua.gr:8080/algorithm/mlr -H subjectid:$token -H Accept:text/uri-list -d dataset_uri=http://apps.ideaconsult.net:8080/ambit2/dataset/R545 -d prediction_feature=http://apps.ideaconsult.net:8080/ambit2/feature/22200 2> /dev/null`!
![Page 27: OpenTox API introductory presentation](https://reader033.vdocument.in/reader033/viewer/2022042715/559c455a1a28ab9a218b45d6/html5/thumbnails/27.jpg)
Algorithms [Task API]
![Page 28: OpenTox API introductory presentation](https://reader033.vdocument.in/reader033/viewer/2022042715/559c455a1a28ab9a218b45d6/html5/thumbnails/28.jpg)
Algorithms [Task API]
while [ $status -eq 202 ]!do! sleep 2! status=$(curl --write-out %{http_code} \! --silent --output /dev/null $task_uri)!done!
![Page 29: OpenTox API introductory presentation](https://reader033.vdocument.in/reader033/viewer/2022042715/559c455a1a28ab9a218b45d6/html5/thumbnails/29.jpg)
Algorithms [Task API]
while [ $status -eq 202 ]!do! sleep 2! status=$(curl --write-out %{http_code} \! --silent --output /dev/null $task_uri)!done!
model_uri=`curl -H subjectid:$token -H Accept:text/uri-list $task_uri 2> /dev/null`!
![Page 30: OpenTox API introductory presentation](https://reader033.vdocument.in/reader033/viewer/2022042715/559c455a1a28ab9a218b45d6/html5/thumbnails/30.jpg)
Algorithms [PMML Transformations]
Example request:!curl -X POST -v -include \! --form [email protected] \! --form epsilon=0.03 \! --form kernel=rbf \! -H Content-Type:multipart/form-data \! http://opentox.ntua.gr:8080/algorithm/svm!
![Page 31: OpenTox API introductory presentation](https://reader033.vdocument.in/reader033/viewer/2022042715/559c455a1a28ab9a218b45d6/html5/thumbnails/31.jpg)
Models [Export]
The PMML format is available for some models (planning to provide full support in the future) for the sake of portability and transparency.
![Page 32: OpenTox API introductory presentation](https://reader033.vdocument.in/reader033/viewer/2022042715/559c455a1a28ab9a218b45d6/html5/thumbnails/32.jpg)
Models [Predict]
Models are used to produce predictions given a dataset or a compound. A POST is used to perform such predictions.
![Page 33: OpenTox API introductory presentation](https://reader033.vdocument.in/reader033/viewer/2022042715/559c455a1a28ab9a218b45d6/html5/thumbnails/33.jpg)
Validation
![Page 34: OpenTox API introductory presentation](https://reader033.vdocument.in/reader033/viewer/2022042715/559c455a1a28ab9a218b45d6/html5/thumbnails/34.jpg)
Error reports
If anything goes wrong a
detailed error report is
returned to the client.
![Page 35: OpenTox API introductory presentation](https://reader033.vdocument.in/reader033/viewer/2022042715/559c455a1a28ab9a218b45d6/html5/thumbnails/35.jpg)
Take-home messages ¡ The OpenTox REST API dictates (i) how existing
services can be consumed and (ii) how to build OpenTox-compliant predictive toxicology WSs,
¡ We are still around: ToxBank, eNanoMapper, Bioclipse and other projects support (or contribute to) the OpenTox API,
¡ More info: http://opentox.org and http://opentox.ntua.gr
![Page 36: OpenTox API introductory presentation](https://reader033.vdocument.in/reader033/viewer/2022042715/559c455a1a28ab9a218b45d6/html5/thumbnails/36.jpg)
Thank you for your attention.