├── README.md
├── ambit-json-docs
├── README.md
├── algorithm.md
├── bundle.md
├── dataset.md
├── feature.md
├── model.md
├── query.md
├── restpolicy.md
├── substance.md
├── substance_dataset.md
├── substance_property.md
├── substance_withstudysummary.md
└── toxtree.md
├── appdomain-example
└── README.md
├── examples-ml
├── pom.xml
└── src
│ └── main
│ ├── java
│ └── net
│ │ └── idea
│ │ └── examples
│ │ └── ml
│ │ └── ClusteringApp.java
│ └── resources
│ └── META-INF
│ └── MANIFEST.MF
├── excapedb
├── excapedb.ipynb
└── logging_config.ini
├── molbrowser
├── README.md
├── pom.xml
└── src
│ └── main
│ ├── java
│ └── net
│ │ └── idea
│ │ └── ambit
│ │ └── molbrowser
│ │ ├── MainApp.java
│ │ └── MolbrowserWizard.java
│ └── resources
│ ├── META-INF
│ └── MANIFEST.MF
│ └── webapp
│ ├── 24x24_ambit.gif
│ ├── favicon.ico
│ ├── index.html
│ ├── scripts
│ ├── jquery-1.7.1.min.js
│ ├── jquery-ui-1.8.18.custom.min.js
│ ├── jquery.dataTables-1.9.0.min.js
│ └── molbrowser.js
│ └── styles
│ ├── ambit.css
│ ├── base.css
│ ├── images
│ ├── ui-bg_glass_55_bcf903_1x400.png
│ ├── ui-bg_gloss-wave_100_ece8da_500x100.png
│ ├── ui-bg_highlight-hard_100_fafaf4_1x100.png
│ ├── ui-bg_highlight-hard_100_ffffff_1x100.png
│ ├── ui-bg_highlight-hard_15_86ad2d_1x100.png
│ ├── ui-bg_highlight-hard_95_cccccc_1x100.png
│ ├── ui-bg_highlight-soft_25_bcf903_1x100.png
│ ├── ui-bg_highlight-soft_95_ffedad_1x100.png
│ ├── ui-bg_inset-soft_15_2b2922_1x100.png
│ ├── ui-icons_516473_256x240.png
│ ├── ui-icons_847e71_256x240.png
│ ├── ui-icons_8dc262_256x240.png
│ ├── ui-icons_cd0a0a_256x240.png
│ └── ui-icons_eeeeee_256x240.png
│ ├── jquery-ui-1.8.18.custom.css
│ ├── jquery.dataTables.css
│ ├── layout.css
│ └── skeleton.css
├── smirks-example
├── Readme.md
├── pom.xml
├── src
│ ├── main
│ │ ├── java
│ │ │ └── net
│ │ │ │ └── idea
│ │ │ │ └── examples
│ │ │ │ └── ambit
│ │ │ │ └── smirks
│ │ │ │ ├── ChemWizard.java
│ │ │ │ └── MainApp.java
│ │ └── resources
│ │ │ ├── META-INF
│ │ │ └── MANIFEST.MF
│ │ │ └── net
│ │ │ └── idea
│ │ │ └── examples
│ │ │ ├── ambit
│ │ │ └── smirks
│ │ │ │ └── example1.properties
│ │ │ ├── lacticacid.sdf
│ │ │ └── test.sdf
│ ├── site
│ │ ├── apt
│ │ │ └── index.apt
│ │ ├── resources
│ │ │ └── images
│ │ │ │ └── ideaconsult_80.png
│ │ └── site.xml
│ └── test
│ │ └── java
│ │ └── net
│ │ └── idea
│ │ └── examples
│ │ └── ambit
│ │ └── smirks
│ │ ├── SMARTSTest.java
│ │ └── SmilesTest.java
└── toxtree-metabolites.png
├── standardize
├── ambit_standardize_demo.ipynb
├── test.txt
└── test_std.txt
├── tautomers-example
├── ChangeLog.md
├── README.md
├── docs.md
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ └── net
│ │ │ └── idea
│ │ │ └── example
│ │ │ └── ambit
│ │ │ ├── tautomers
│ │ │ ├── GenerationParameters.java
│ │ │ ├── MainApp.java
│ │ │ ├── TautomerWizard.java
│ │ │ └── ZwitterionCli.java
│ │ │ └── writers
│ │ │ └── RDFTautomersWriter.java
│ └── resources
│ │ ├── META-INF
│ │ └── MANIFEST.MF
│ │ └── logging.properties
│ └── test
│ ├── java
│ └── net
│ │ └── idea
│ │ └── example
│ │ └── ambit
│ │ └── tautomers
│ │ └── TautomersTest.java
│ └── resources
│ ├── MolInf2013
│ ├── AmbitTatutomersSet1.zip
│ ├── AmbitTautomersSet2.zip
│ ├── AmbitTautomersSet3.zip
│ ├── AmbitTautomersSet4.zip
│ ├── AmbitTautomersSet5.zip
│ ├── AmbitTautomersSet6.zip
│ └── README.md
│ └── net
│ └── idea
│ └── example
│ └── ambit
│ └── tautomers
│ ├── drugbank_error.sdf
│ ├── inchi.txt
│ └── input.sdf
└── tautomers-jmh
├── README.md
├── pom.xml
└── src
└── main
├── java
└── net
│ └── idea
│ └── benchmark
│ └── TautomersBenchmark.java
└── resources
└── net
└── idea
└── benchmark
├── CHEMBL2373570.sdf
└── warfarin.mol
/README.md:
--------------------------------------------------------------------------------
1 | examples
2 | ==============
3 |
4 | This project consists of examples how to call [AMBIT](http://ambit.sourceforge.net/ "AMBIT") modules from Java code.
5 |
6 | AMBIT source code and site is at [Sourceforge.net](http://ambit.sourceforge.net/)
7 |
8 | AMBIT publications http://ambit.sourceforge.net/pubs_citeambit.html
9 |
10 | AMBIT Web REST services
11 | ---
12 |
13 | * Publication [doi:10.1186/1758-2946-3-18](http://www.jcheminf.com/content/3/1/18)
14 |
15 | * Download http://ambit.sourceforge.net/download_ambitrest.html
16 |
17 | * ambit2-www.war at [Maven repository](https://nexus.ideaconsult.net/index.html#nexus-search;quick~ambit2-www)
18 |
19 | * OpenTox API [examples](http://ambit.sourceforge.net/api.html)
20 |
21 | * Ambit [JSON extension](https://github.com/ideaconsult/examples-ambit/tree/master/ambit-json-docs) of OpenTox API
22 |
23 | * Ambit/OpenTox REST API client library https://github.com/ideaconsult/opentox-cli
24 |
25 | * [Ambit API documentation ](http://ideaconsult.github.io/examples-ambit/apidocs/)
26 |
27 |
28 |
29 | SMARTS (and SMIRKS)
30 | ---
31 |
32 | * Publication [doi:10.1002/minf.201100028](http://onlinelibrary.wiley.com/doi/10.1002/minf.201100028/abstract)
33 |
34 | * Ambit2-SMARTS examples at http://ambit.sourceforge.net/AMBIT2-LIBS/ambit2-smarts/index.html
35 |
36 | * ambit2-smarts.jar at [Maven repository](https://nexus.ideaconsult.net/index.html#nexus-search;quick%7Eambit2-smarts)
37 |
38 | Tautomers generation
39 | ---
40 |
41 | * Publication [doi:10.1002/minf.201200133](http://onlinelibrary.wiley.com/doi/10.1002/minf.201200133/abstract) and EuroQSAR 2012 [poster](http://www.slideshare.net/jeliazkova_nina/ambittautomer-an-open-source-tool-for-tautomer-generation)
42 |
43 | * Code example and a command line application at [tautomers-example](https://github.com/ideaconsult/examples-ambit/tree/master/tautomers-example)
44 |
45 | * Ambit2-tautomer module at [Sourceforge.net](http://ambit.sourceforge.net/AMBIT2-LIBS/ambit2-tautomers/index.html).
46 |
47 | * ambit2-tautomer.jar [download](https://sourceforge.net/projects/ambit/files/Ambit2/AMBIT_modules/2.4.11/)
48 |
49 | * ambit2-tautomer.jar at [Maven repository](https://nexus.ideaconsult.net/index.html#nexus-search;quick%7Eambit2-tautomer)
50 |
51 | Chemical structure standardization
52 | ---
53 |
54 | * Code example : Jupyter notebook [standardize/ambit_standardize_demo.ipynb](standardize/ambit_standardize_demo.ipynb)
55 |
56 | Applicability domain command line appliction
57 | ---
58 |
59 | * https://github.com/ideaconsult/examples-ambit/tree/master/appdomain-example
60 |
61 | JavaScript Molecular browser
62 | ---
63 |
64 | * Publishing a chemical dataset online is easy - just convert SDF file to [JSON](http://www.json.org/) and a folder of images with [molbrowser command line application](https://github.com/ideaconsult/examples-ambit/tree/master/molbrowser).
65 |
66 | * Try it at http://ideaconsult.github.io/examples-ambit/molbrowser/
67 |
68 |
69 | More examples
70 | ----------------
71 |
72 | * Coming soon!
73 |
74 |
75 |
--------------------------------------------------------------------------------
/ambit-json-docs/README.md:
--------------------------------------------------------------------------------
1 | ## OpenTox REST API
2 |
3 | [OpenTox](http://opentox.org) is an European Commission Framework Program 7 funded project (2008-2011),
4 | aims to develop distributed framework for predictive toxicology.
5 | The building blocks considered are : data, chemical structures, algorithms and models.
6 | The framework allows to build models, apply models, validate models, access and query data in various ways.
7 | Technologies used are [REST](http://ambit.sourceforge.net/rest.html) style web services and [W3C Resource Description Framework](http://ambit.sourceforge.net/rdf.html) for description of services.
8 |
9 | * API Documentation http://opentox.org/dev/apis/api-1.2
10 | * OpenTox API discussion, new ideas and examples at https://github.com/opentox-api
11 | * API Documentation by Swagger-ui http://ideaconsult.github.io/examples-ambit/apidocs/
12 |
13 | ### JSON
14 |
15 | OpenTox mandatory representation of REST resources is [RDF](http://www.w3.org/RDF/) (W3C Resource Description Framework).
16 | Examples: [1](http://opentox.org/dev/apis/api-1.2/dataset),[2](http://ambit.sourceforge.net/api_dataset.html).
17 |
18 | The JSON representation is a new development, implemented in AMBIT web services [1](http://ambit.sf.net),[2](http://www.jcheminf.com/content/3/1/18), [3](http://www.beilstein-journals.org/bjnano/single/articleFullText.htm?publicId=2190-4286-6-165).
19 |
20 | * The JSON or JSONP representation could be retrieved via HTTP Accept headers **"application/json"** or **"application/x-javascript"** respectively. The callback parameter when using JSONP is 'callback'.
21 | * As a workaround for web browsers restriction, the URI parameter **?media=application/json** or **?media=application/x-javascript** could be used.
22 |
23 | * How to access [Datasets](dataset.md)
24 | * How to [search chemical compounds](query.md)
25 | * How to access [Algorithms](algorithm.md)
26 | * How to access [Models](model.md)
27 |
28 |
29 | ### Example
30 |
31 | * How to [run Toxtree predictions](toxtree.md) using REST web services and JSON.
32 | * Try [Toxtree web edition](http://toxtree.sf.net/predict)
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/ambit-json-docs/algorithm.md:
--------------------------------------------------------------------------------
1 | ## OpenTox REST API: Algorithm
2 |
3 | *Provides access to OpenTox algorithms.*
4 |
5 | * There are multiple kinds of algorithms (descriptor calculation, machine learning procedures or various data preprocessing).
6 | * Generally, a machine learning algorithm takes a [dataset](dataset.md) URI as input and generate a [model](model.md), also identified with an URI.
7 | * The Algorithm types ontology provides a hierarchical classification of [Algorithm types](http://opentox.org/data/documents/development/RDF%20files/AlgorithmTypes).
8 | * Documentation (wiki) http://opentox.org/dev/apis/api-1.2/Algorithm
9 | * Documentation (runnable) http://ideaconsult.github.io/examples-ambit/apidocs/#!/algorithm
10 |
11 | ### JSON
12 |
13 | OpenTox mandatory representation of REST resources is [RDF](http://www.w3.org/RDF/) (W3C Resource Description Framework).
14 | Examples: [1](http://opentox.org/dev/apis/api-1.2/algorithm),[2](http://ambit.sourceforge.net/api_algorithm.html).
15 |
16 | The JSON representation is a new development, implemented in AMBIT web services [1](http://ambit.sf.net),[2](http://www.jcheminf.com/content/3/1/18).
17 |
18 | * The algorithm JSON representation closely follows the RDF data model;
19 |
20 | * The JSON or JSONP representation could be retrieved via HTTP Accept headers **"application/json"** or **"application/x-javascript"** respectively.
21 | * As a workaround for web browsers restriction, the URI parameter **?media=application/json** or **?media=application/x-javascript** could be used.
22 |
23 | ````json
24 | {
25 | "algorithm": [
26 | {
27 | "uri": "http://host:port/ambit2/algorithm/SimpleKMeans",
28 | "id": "SimpleKMeans",
29 | "name": "Clustering: k-means",
30 | "type": [
31 | "http://www.opentox.org/algorithmTypes.owl#Clustering",
32 | "http://www.opentox.org/algorithmTypes.owl#SingleTarget",
33 | "http://www.opentox.org/algorithmTypes.owl#LazyLearning",
34 | "http://www.opentox.org/algorithmTypes.owl#UnSupervised"
35 | ]
36 | },
37 | {
38 | "uri": "http://host:port/ambit2/algorithm/J48",
39 | "id": "J48",
40 | "name": "Classification: Decision tree J48",
41 | "type": [
42 | "http://www.opentox.org/algorithmTypes.owl#Classification",
43 | "http://www.opentox.org/algorithmTypes.owl#SingleTarget",
44 | "http://www.opentox.org/algorithmTypes.owl#EagerLearning",
45 | "http://www.opentox.org/algorithmTypes.owl#Supervised"
46 | ]
47 | },
48 | {
49 | "uri": "http://host:port/ambit2/algorithm/LR",
50 | "id": "LR",
51 | "name": "Regression: Linear regression",
52 | "type": [
53 | "http://www.opentox.org/algorithmTypes.owl#Regression",
54 | "http://www.opentox.org/algorithmTypes.owl#SingleTarget",
55 | "http://www.opentox.org/algorithmTypes.owl#EagerLearning",
56 | "http://www.opentox.org/algorithmTypes.owl#Supervised"
57 | ]
58 | },
59 | {
60 | "uri": "http://host:port/ambit2/algorithm/org.openscience.cdk.qsar.descriptors.molecular.XLogPDescriptor",
61 | "id": "org.openscience.cdk.qsar.descriptors.molecular.XLogPDescriptor",
62 | "name": "XLogP",
63 | "endpoint": "http://www.opentox.org/echaEndpoints.owl#Octanol-water_partition_coefficient_Kow",
64 | "implementationOf": "http://www.blueobelisk.org/ontologies/chemoinformatics-algorithms/#xlogP",
65 | "type": [
66 | "http://www.opentox.org/algorithmTypes.owl#DescriptorCalculation"
67 | ]
68 | },
69 | {
70 | "uri": "http://host:port/ambit2/algorithm/toxtreecramer",
71 | "id": "toxtreecramer",
72 | "name": "ToxTree: Cramer rules",
73 | "endpoint": "http://www.opentox.org/echaEndpoints.owl#HumanHealthEffects",
74 | "implementationOf": "http://ambit.sourceforge.net/descriptors.owl#toxtreecramer",
75 | "type": [
76 | "http://www.opentox.org/algorithmTypes.owl#Rules"
77 | ]
78 | }
79 | ]
80 | }
81 | ````
82 |
83 | #### [cURL](http://curl.haxx.se/) examples:
84 |
85 | Retrieve the list of [Descriptor calculation](https://apps.ideaconsult.net/ambit2/algorithm?type=DescriptorCalculation) algorithms
86 | ````
87 | curl -H "Accept:application/x-javascript" "https://apps.ideaconsult.net/ambit2/algorithm?type=DescriptorCalculation"
88 | ````
89 |
90 | Retrieve the list of [Classification](https://apps.ideaconsult.net/ambit2/algorithm?type=Classification) algorithms
91 | ````
92 | curl "https://apps.ideaconsult.net/ambit2/algorithm?type=Classification&media=application/json"
93 | ````
94 |
95 | Retrieve the list of [Regression](https://apps.ideaconsult.net/ambit2/algorithm?type=Regression) algorithms
96 | ````
97 | curl -H "Accept:application/json" https://apps.ideaconsult.net/ambit2/algorithm?type=Regression
98 | ````
99 |
100 | Retrieve the list of algorithms based on [Expert rules](https://apps.ideaconsult.net/ambit2/algorithm?type=Rules)
101 | ````
102 | curl "https://apps.ideaconsult.net/ambit2/algorithm?type=Rules&media=application/x-javascript"
103 | ````
104 |
105 | Retrieve the list of [Applicability domain](https://apps.ideaconsult.net/ambit2/algorithm?type=AppDomain) algorithms
106 | ````
107 | curl "https://apps.ideaconsult.net/ambit2/algorithm?type=AppDomain&media=application/x-javascript"
108 | ````
109 |
110 | ### The ontology entries
111 |
112 | * An algorithm resource may contain an "implementationOf" field, linking to the BlueObelisk ontology , e.g. http://www.blueobelisk.org/ontologies/chemoinformatics-algorithms/#xlogP.
113 | * The BlueObelisk ontology provides details of the algorithm itself, e.g. publication reference.
114 | * The BlueObelisk ontology can be queried via Ontology service [SPARQL](https://apps.ideaconsult.net/ontology/query/BODO).
115 |
116 | * An algorithm resource may contain an "endpoint" field, linking to the [endpoints ontology](http://www.opentox.org/echaEndpoints.owl) , e.g. http://www.opentox.org/echaEndpoints.owl#Carcinogenicity.
117 |
--------------------------------------------------------------------------------
/ambit-json-docs/dataset.md:
--------------------------------------------------------------------------------
1 | ## OpenTox REST API: Dataset
2 |
3 | Provides access to chemical compounds and their features (e.g. structural, physical-chemical, biological, toxicological properties).
4 |
5 | The concept of a Dataset of chemical compounds is central to OpenTox web services functionality.
6 |
7 | * Algorithm services accept dataset URI in order to build a model, or to generate descriptor values.
8 | * Model services accept dataset URI in order to apply a model and obtain predictions.
9 | * Predictions are again returned as dataset URI, which could be subsequently retrieved.
10 | * Search results (exact chemical structure, similarity or substructure) are also available as datasets.
11 | * Documentation (wiki) http://opentox.org/dev/apis/api-1.2/dataset
12 | * Documentation (runnable) http://ideaconsult.github.io/examples-ambit/apidocs/#!/dataset
13 |
14 | ### JSON
15 |
16 | OpenTox mandatory representation of REST resources is [RDF](http://www.w3.org/RDF/) (W3C Resource Description Framework).
17 | Examples: [1](http://opentox.org/dev/apis/api-1.2/dataset),[2](http://ambit.sourceforge.net/api_dataset.html).
18 |
19 | The JSON representation is a new development, implemented in AMBIT web services [1](http://ambit.sf.net),[2](http://www.jcheminf.com/content/3/1/18).
20 |
21 | * The dataset JSON representation closely follows the RDF data model;
22 | * The dataset consists of data entries (or data rows);
23 | * Each row is associated with exactly one chemical compound, identified by its URL and available via OpenTox Compound service API;
24 | * One and the same compound URL can be associated with multiple dataset rows;
25 | * Every column is associated with a Feature URL, representation should be available via OpenTox [Feature](feature.md) API. A feature is identified by its URL and has name and source,along with other properties. Any OpenTox [Dataset](dataset.md), [Algorithm](algorithm.md) or [Model](model.md) can serve as feature source.
26 |
27 | * The JSON or JSONP representation could be retrieved via HTTP Accept headers **"application/json"** or **"application/x-javascript"** respectively.
28 | * As a workaround for web browsers restriction, the URI parameter **?media=application/json** or **?media=application/x-javascript** could be used.
29 |
30 |
31 |
32 | ````json
33 | {
34 | "query": {
35 | "summary": "Query description"
36 | },
37 | "dataEntry": [
38 | {
39 | "compound": {
40 | "URI": "http://apps.ideaconsult.net/ambit2/compound/{id}/conformer/{id}"
41 | },
42 | "values": {
43 | "key1": "value1",
44 | "key2": 3.14
45 | }
46 | },
47 | {
48 | "compound": {
49 | "URI": "http://host:port/ambit2/compound/{id}/conformer/{id}"
50 | },
51 | "values": {
52 | "key1": "value3",
53 | "key3": "value4"
54 | }
55 | }
56 | ],
57 | "feature": {
58 | "key1": {
59 | "type": "Feature",
60 | "title": "Title1",
61 | "units": "",
62 | "isNominal": false,
63 | "isNumeric": false,
64 | "sameAs": "ONTOLOGY_ENTRY",
65 | "isModelPredictionFeature": false,
66 | "creator": "URI",
67 | "order": 1,
68 | "source": {
69 | "URI": "URI of a dataset, algorithm, or a model",
70 | "type": "Dataset"
71 | }
72 | },
73 | "key2": {
74 | "type": "Feature",
75 | "title": "Title2",
76 | "units": "",
77 | "isNominal": false,
78 | "isNumeric": true,
79 | "sameAs": "ONTOLOGY_ENTRY",
80 | "isModelPredictionFeature": false,
81 | "creator": "URI",
82 | "order": 3,
83 | "source": {
84 | "URI": "URI of a dataset, algorithm, or a model",
85 | "type": "Algorithm"
86 | }
87 | },
88 | "key3": {
89 | "type": "Feature",
90 | "title": "Title 3",
91 | "units": "",
92 | "isNominal": false,
93 | "isNumeric": false,
94 | "sameAs": "ONTOLOGY_ENTRY",
95 | "isModelPredictionFeature": true,
96 | "creator": "URI",
97 | "order": 2,
98 | "source": {
99 | "URI": "URI of a dataset, algorithm, or a model",
100 | "type": "Model"
101 | }
102 | }
103 | }
104 | }
105 | ````
106 |
107 | #### [cURL](http://curl.haxx.se/) examples:
108 |
109 | [Search](https://apps.ideaconsult.net/ambit2/query/compound/search/all?search=caffeine&media=application/json&page=0&pagesize=1) for compound with name *caffeine*
110 | ````
111 | curl -H "Accept:application/json" \
112 | "https://apps.ideaconsult.net/ambit2/query/compound/search/all?search=caffeine&page=0&pagesize=1"
113 | ````
114 |
115 | Retrieve the first 10 record of [dataset/1](https://apps.ideaconsult.net/ambit2/dataset/12?page=0&pagesize=10)
116 | ````
117 | https://apps.ideaconsult.net/ambit2/dataset/12?media=application/json&page=0&pagesize=10
118 | ````
119 |
120 |
121 | ### The ontology entries
122 |
123 | In RDF the feature type is denoted by a mandatory link to an ontology via owl:sameAs or directly subclassing a class from an ontology.
124 | The JSON representation uses the key **"sameAs"** and the same ontology URIs.
125 |
126 | The following ontology entries are used to denote:
127 |
128 | #### Chemical identifiers [opentox.owl](http://www.opentox.org/api/1.1/opentox.owl):
129 |
130 | * [CAS Registry](http://en.wikipedia.org/wiki/CAS_registry_number) number : "http://www.opentox.org/api/1.1#CASRN"
131 | * [EC Registry](http://en.wikipedia.org/wiki/European_Commission_number) number : "http://www.opentox.org/api/1.1#EINECS"
132 | * [IUPAC](http://www.iupac.org/) name : "http://www.opentox.org/api/1.1#IUPACName"
133 | * Chemical name : "http://www.opentox.org/api/1.1#ChemicalName"
134 | * [SMILES](http://en.wikipedia.org/wiki/Simplified_molecular-input_line-entry_system) : "http://www.opentox.org/api/1.1#SMILES"
135 | * [InChI](http://en.wikipedia.org/wiki/Inchi) : "http://www.opentox.org/api/1.1#InChI_std"
136 | * [InChIKey](http://en.wikipedia.org/wiki/Inchi) : "http://www.opentox.org/api/1.1#InChIKey_std"
137 |
138 | #### Toxicological endpoints [echaEndpoints.owl](http://www.opentox.org/echaEndpoints.owl), [SPARQL](http://apps.ideaconsult.net/ontology/query/Endpoints)
139 |
140 | Examples:
141 |
142 | * Fish toxicity http://www.opentox.org/echaEndpoints.owl#Acute_toxicity_to_fish_lethality
143 | * Carcinogenicity http://www.opentox.org/echaEndpoints.owl#Carcinogenicity
144 |
145 |
146 |
147 |
--------------------------------------------------------------------------------
/ambit-json-docs/feature.md:
--------------------------------------------------------------------------------
1 | ## OpenTox REST API: Feature
2 |
3 | A Feature is a resource, representing any kind of a property or identifier, assigned to a Compound.
4 |
5 | * The feature types are determined via their links to ontologies, e.g. [BlueObelisk ontology](http://apps.ideaconsult.net:8080/ontology/query/BODO) and [ECHA endpoints ontology](http://www.opentox.org/echaEndpoints.owl).
6 | * Documentation (wiki) http://opentox.org/dev/apis/api-1.2/Feature
7 | * Documentation (runnable) http://ideaconsult.github.io/examples-ambit/apidocs/#!/feature
8 |
9 | ### JSON
10 |
11 | OpenTox mandatory representation of REST resources is [RDF](http://www.w3.org/RDF/) (W3C Resource Description Framework).
12 | Examples: [1](http://opentox.org/dev/apis/api-1.2/Feature),[2](http://ambit.sourceforge.net/api_feature.html).
13 |
14 | The JSON representation is a new development, implemented in AMBIT web services [1](http://ambit.sf.net),[2](http://www.jcheminf.com/content/3/1/18).
15 |
16 | * The dataset JSON representation closely follows the RDF data model;
17 | * A feature is identified by its URL and has a title, source,along with other properties
18 | * Title *title:*
19 | * Units *units:*
20 | * The origin of the Feature *source:*. Any OpenTox [Dataset](dataset.md), [Algorithm](algorithm.md) or [Model](model.md) can serve as feature source.
21 | * Relations to other resources, which represent the same entity, could be established via *sameAs:* property.
22 | * This approach is be used for example to link the [feature](feature.md) resource to a resource form another [ontology](#ONTOLOGY_ENTRY).
23 | * *isNumeric* denotes if a feature holds numeric or string values.
24 | * *isNominal* denote if a feature holds nominal values (a predefined list of string values).
25 |
26 | * The JSON or JSONP representation could be retrieved via HTTP Accept headers **"application/json"** or **"application/x-javascript"** respectively.
27 | * As a workaround for web browsers restriction, the URI parameter **?media=application/json** or **?media=application/x-javascript** could be used.
28 |
29 |
30 |
31 | ````json
32 | {
33 | "feature": {
34 | "key1": {
35 | "type": "Feature",
36 | "title": "Title1",
37 | "units": "",
38 | "isNominal": false,
39 | "isNumeric": false,
40 | "sameAs": "ONTOLOGY_ENTRY",
41 | "isModelPredictionFeature": false,
42 | "creator": "URI",
43 | "order": 1,
44 | "source": {
45 | "URI": "URI of a dataset, algorithm, or a model",
46 | "type": "Dataset"
47 | }
48 | },
49 | "key2": {
50 | "type": "Feature",
51 | "title": "Title2",
52 | "units": "",
53 | "isNominal": false,
54 | "isNumeric": true,
55 | "sameAs": "ONTOLOGY_ENTRY",
56 | "isModelPredictionFeature": false,
57 | "creator": "URI",
58 | "order": 3,
59 | "source": {
60 | "URI": "URI of a dataset, algorithm, or a model",
61 | "type": "Algorithm"
62 | }
63 | },
64 | "key3": {
65 | "type": "Feature",
66 | "title": "Title 3",
67 | "units": "",
68 | "isNominal": false,
69 | "isNumeric": false,
70 | "sameAs": "ONTOLOGY_ENTRY",
71 | "isModelPredictionFeature": true,
72 | "creator": "URI",
73 | "order": 2,
74 | "source": {
75 | "URI": "URI of a dataset, algorithm, or a model",
76 | "type": "Model"
77 | }
78 | }
79 | }
80 | }
81 | ````
82 |
83 | #### [cURL](http://curl.haxx.se/) examples:
84 |
85 | ##### [Retrieve dataset features](http://apps.ideaconsult.net:8080/ambit2/dataset/1/feature). More about [dataset](dataset.md).
86 | ````
87 | curl -H "Accept:application/json" \
88 | "http://apps.ideaconsult.net:8080/ambit2/dataset/1/feature"
89 | ````
90 | Result
91 | ````json
92 | {
93 | "feature": {
94 | "http://apps.ideaconsult.net:8080/ambit2/feature/2": {
95 | "type": "Feature",
96 | "title": "CasRN",
97 | "isNominal": false,
98 | "isNumeric": false,
99 | "sameAs": "http://www.opentox.org/api/1.1#CASRN",
100 | "isModelPredictionFeature": "false",
101 | "creator": "http://apps.echa.europa.eu/preregistered/prsDownload.aspx",
102 | "source": {
103 | "URI": "http://apps.ideaconsult.net:8080/ambit2/dataset/ECHA",
104 | "type": "Dataset"
105 | }
106 | },
107 | "http://apps.ideaconsult.net:8080/ambit2/feature/3": {
108 | "type": "Feature",
109 | "title": "EC",
110 | "isNominal": false,
111 | "isNumeric": false,
112 | "sameAs": "http://www.opentox.org/api/1.1#EINECS",
113 | "isModelPredictionFeature": "false",
114 | "creator": "http://apps.echa.europa.eu/preregistered/prsDownload.aspx",
115 | "source": {
116 | "URI": "http://apps.ideaconsult.net:8080/ambit2/dataset/ECHA",
117 | "type": "Dataset"
118 | }
119 | },
120 | "http://apps.ideaconsult.net:8080/ambit2/feature/4": {
121 | "type": "Feature",
122 | "title": "Names",
123 | "units": "",
124 | "isNominal": false,
125 | "isNumeric": true,
126 | "sameAs": "http://www.opentox.org/api/1.1#ChemicalName",
127 | "isModelPredictionFeature": "false",
128 | "creator": "http://apps.echa.europa.eu/preregistered/prsDownload.aspx",
129 | "source": {
130 | "URI": "http://apps.ideaconsult.net:8080/ambit2/dataset/ECHA",
131 | "type": "Dataset"
132 | }
133 | }
134 | }
135 | }
136 | ````
137 |
138 | ###### [Retrieve model output variables](http://apps.ideaconsult.net:8080/ambit2/model/2/predicted)
139 | ````
140 | curl "http://apps.ideaconsult.net:8080/ambit2/model/2/predicted?media=application/json&page=0&pagesize=10"
141 | ````
142 |
143 | Result
144 | ````json
145 | {
146 | "feature": {
147 | "http://apps.ideaconsult.net:8080/ambit2/feature/9042927": {
148 | "type": "Feature",
149 | "title": "Cramer rules",
150 | "isNominal": "false",
151 | "isNumeric": "false",
152 | "sameAs": "Cramer rules",
153 | "isModelPredictionFeature": "false",
154 | "creator": "http://toxtree.sourceforge.net/cramer.html",
155 | "order": 9042927,
156 | "source": {
157 | "URI": "http://apps.ideaconsult.net:8080/ambit2/algorithm/Cramer+rules",
158 | "type": "Algorithm"
159 | }
160 | },
161 | "http://apps.ideaconsult.net:8080/ambit2/feature/9042928": {
162 | "type": "Feature",
163 | "title": "Cramer rules#explanation",
164 | "isNominal": "false",
165 | "isNumeric": "false",
166 | "sameAs": "Cramer rules#explanation",
167 | "isModelPredictionFeature": "false",
168 | "creator": "http://toxtree.sourceforge.net/cramer.html",
169 | "source": {
170 | "URI": "http://apps.ideaconsult.net:8080/ambit2/algorithm/Cramer+rules",
171 | "type": "Algorithm"
172 | }
173 | }
174 | }
175 | }
176 | ````
177 |
178 | ### The ontology entries
179 |
180 | In RDF the feature type is denoted by a mandatory link to an ontology via owl:sameAs or directly subclassing a class from an ontology.
181 | The JSON representation uses the key **"sameAs"** and the same ontology URIs.
182 |
183 | The following ontology entries are used to denote:
184 |
185 | #### Chemical identifiers [opentox.owl](http://www.opentox.org/api/1.1/opentox.owl):
186 |
187 | * [CAS Registry](http://en.wikipedia.org/wiki/CAS_registry_number) number : "http://www.opentox.org/api/1.1#CASRN"
188 | * [EC Registry](http://en.wikipedia.org/wiki/European_Commission_number) number : "http://www.opentox.org/api/1.1#EINECS"
189 | * [IUPAC](http://www.iupac.org/) name : "http://www.opentox.org/api/1.1#IUPACName"
190 | * Chemical name : "http://www.opentox.org/api/1.1#ChemicalName"
191 | * [SMILES](http://en.wikipedia.org/wiki/Simplified_molecular-input_line-entry_system) : "http://www.opentox.org/api/1.1#SMILES"
192 | * [InChI](http://en.wikipedia.org/wiki/Inchi) : "http://www.opentox.org/api/1.1#InChI_std"
193 | * [InChIKey]((http://en.wikipedia.org/wiki/Inchi)"http://www.opentox.org/api/1.1#InChIKey_std"
194 |
195 | #### Toxicological endpoints [echaEndpoints.owl](http://www.opentox.org/echaEndpoints.owl), [SPARQL](http://apps.ideaconsult.net:8080/ontology/query/Endpoints)
196 |
197 | Examples:
198 |
199 | * Fish toxicity http://www.opentox.org/echaEndpoints.owl#Acute_toxicity_to_fish_lethality
200 | * Carcinogenicity http://www.opentox.org/echaEndpoints.owl#Carcinogenicity
201 |
202 |
203 |
204 |
--------------------------------------------------------------------------------
/ambit-json-docs/model.md:
--------------------------------------------------------------------------------
1 | ## OpenTox REST API: Models
2 |
3 | Provides different representations for QSAR/toxicology models.
4 |
5 | * Models are the output/result of (learning) [algorithms](algorithm.md) and cannot be modified.
6 | * To apply a model, it is necessary to provide as input a [dataset](dataset.md) with compatible descriptors/features.
7 | * Documentation http://opentox.org/dev/apis/api-1.2/Model
8 | * Documentation (runnable) http://ideaconsult.github.io/examples-ambit/apidocs/#!/model
9 |
10 |
11 | ### JSON
12 |
13 | OpenTox mandatory representation of REST resources is [RDF](http://www.w3.org/RDF/) (W3C Resource Description Framework).
14 | Examples: [1](http://opentox.org/dev/apis/api-1.2/algorithm),[2](http://ambit.sourceforge.net/api_algorithm.html).
15 |
16 | The JSON representation is a new development, implemented in AMBIT web services [1](http://ambit.sf.net),[2](http://www.jcheminf.com/content/3/1/18).
17 |
18 | * The model JSON representation closely follows the RDF representation;
19 |
20 | * The JSON or JSONP representation could be retrieved via HTTP Accept headers **"application/json"** or **"application/x-javascript"** respectively.
21 | * As a workaround for web browsers restriction, the URI parameter **?media=application/json** or **?media=application/x-javascript** could be used.
22 |
23 | #### Models
24 | #####Retrieve first 10 models
25 | ````
26 | curl -H "Accept:application/json" "http://host:port/ambit2/model?page=0&pagesize=10"
27 | ````
28 |
29 | Example:
30 | ````
31 | curl -H "Accept:application/json" "https://apps.ideaconsult.net/ambit2/model?page=0&pagesize=10"
32 | ````
33 |
34 | ````json
35 | todo
36 |
37 | ````
38 |
39 | #####Retrieve a model, created by a given algorithm
40 |
41 | ````
42 | curl -H "Accept:application/json" http://host:port/ambit2/model?algorithm=ALGORITHM_URI
43 | ````
44 |
45 | Example: Retrieve the model, which will apply the Cramer rules algorithm
46 |
47 | See [Toxtree examples](toxtree.md)
48 |
49 |
50 | ######Create a model
51 | ````
52 | curl -X POST http://host:port/ambit2/algorithm/{id} -H "Accept:application/json"
53 | ````
54 | a task is returned
55 |
56 | ````json
57 | {"task": [
58 | {
59 | "uri":"http://host:port/ambit2/task/{id}",
60 | "id": "7aadd2a5-06de-4ae2-851e-3e13ca6811d9",
61 | "name": "The model name",
62 | "status": "Running",
63 | "started": 1371742727965,
64 | "result": "http://host:port/ambit2/task/7aadd2a5-06de-4ae2-851e-3e13ca6811d9",
65 | }
66 | ]
67 | ````
68 |
69 | poll the task
70 | ````
71 | curl -H "Accept:application/json" "http://host:port/ambit2/task/7aadd2a5-06de-4ae2-851e-3e13ca6811d9"
72 | ````
73 |
74 | the task is now completed and the model URI is http://host:port/ambit2/model/{md}
75 | ````json
76 | {"task": [
77 | {
78 | "uri":"http://host:port/ambit2/model/{mid}",
79 | "id": "7aadd2a5-06de-4ae2-851e-3e13ca6811d9",
80 | "name": "Apply algorithm {aid} ",
81 | "status": "Completed",
82 | "started": 1371742727965,
83 | "completed": 1371742727974,
84 | "result": "http://host:port/ambit2/model/{mid}",
85 | }
86 | ]
87 | }
88 | ````
89 |
90 | #### Retrieve model representation by URI
91 |
92 |
93 | ````
94 | curl -H "Accept:application/json" "http://host:port/ambit2/model/{mid}"
95 | ````
96 |
97 | ````json
98 | {
99 | "model": [
100 | {
101 | "URI": "http://host:port/ambit2/model/{mid}",
102 | "id": 2,
103 | "title": "ToxTree: Cramer rules",
104 | "stars": 9,
105 | "algorithm": {
106 | "URI": "http://host:port/ambit2/algorithm/{aid}"
107 | },
108 | "trainingDataset": "http://host:port/ambit2/dataset/{did}",
109 | "independent": "http://host:port/ambit2/model/2/independent",
110 | "dependent": "http://host:port/ambit2/model/{mid}/dependent",
111 | "predicted": "http://host:port/ambit2/model/{mid}/predicted",
112 | "ambitprop": {
113 | "legend": "http://host:port/ambit2/model/{mid}?media=image/png"
114 | }
115 | }
116 | ]
117 | }
118 | ````
119 |
120 | #### Finally, get some prediction (e.g. apply the model to compound or dataset URI )
121 |
122 | ````
123 | curl -X POST -H "Accept:application/json" \
124 | -d "dataset_uri=http://host:port/ambit2/compound/{cid}" \
125 | "http://host:port/ambit2/model/{mid}"
126 | ````
127 |
128 | ######here is the task
129 |
130 | ````json
131 | {
132 | "task": [
133 | {
134 | "uri": "http://host:port/ambit2/task/80552714-de54-4319-9a88-ec9d39f64539",
135 | "id": "80552714-de54-4319-9a88-ec9d39f64539",
136 | "name": "Apply Model {mid} to http://host:port/ambit2/compound/{cid}",
137 | "status": "Running",
138 | "started": 1371743438742,
139 | "result": "http://host:port/ambit2/task/80552714-de54-4319-9a88-ec9d39f64539"
140 | }
141 | ]
142 | }
143 | ````
144 |
145 | ######poll the task
146 | ````
147 | curl -H "Accept:application/json" http://host:port/ambit2/task/80552714-de54-4319-9a88-ec9d39f64539
148 | ````
149 |
150 | ######and now the task is completed. The **result** field contains the URI of the dataset with the predictions.
151 | ````json
152 | {
153 | "task": [
154 | {
155 | "uri": "http://host:port/ambit2/compound/{cid}?feature_uris[]=http%3A%2F%2Fhost%3Aport%2Fambit2%2Fmodel%2Fmid%2Fpredicted",
156 | "id": "80552714-de54-4319-9a88-ec9d39f64539",
157 | "name": "Apply Model {mid} to http://host:port/ambit2/compound/{cid}",
158 | "status": "Completed",
159 | "started": 1371743438742,
160 | "completed": 1371743439633,
161 | "result": "http://host:port/ambit2/compound/{cid}?feature_uris[]=http%3A%2F%2Fhost%3Aport%2Fambit2%2Fmodel%2Fmid%2Fpredicted"
162 | }
163 | ]
164 | }
165 | ````
166 |
167 | ######Retrieve the predictions
168 | ````
169 | curl -H "Accept:application/json" "http://host:port/ambit2/compound/{cid?feature_uris[]=http%3A%2F%2Fhost%3Aport%2Fambit2%2Fmodel%2Fmid%2Fpredicted"
170 | ````
171 |
172 | The resutls are in the same format, as if retrieving a [dataset](dataset.md).
173 |
174 | * For specific examples see the [Toxtree](toxtree.md) page.
175 |
--------------------------------------------------------------------------------
/ambit-json-docs/query.md:
--------------------------------------------------------------------------------
1 | ## Searching chemical compounds
2 |
3 | * Documentation (runnable) [Chemical structure search](http://ideaconsult.github.io/examples-ambit/apidocs/#!/compound_0)
4 |
5 | All search queries return the results in the [dataset](dataset.md) format
6 |
7 | #### Exact search and search by chemical identifier
8 | ````
9 | curl -H "Accept:application/json" \
10 | "http://host:port/ambit2/query/compound/search/all?search=caffeine&page=0&pagesize=1"
11 | ````
12 |
13 | Examples:
14 |
15 | [Search by name](https://apps.ideaconsult.net/ambit2/query/compound/search/all?search=caffeine&media=application/json&page=0&pagesize=1) for compound with name *caffeine*
16 | ````
17 | curl -H "Accept:application/json" \
18 | "https://apps.ideaconsult.net/ambit2/query/compound/search/all?search=caffeine&page=0&pagesize=1"
19 | ````
20 |
21 | [Search by registry number](https://apps.ideaconsult.net/ambit2/query/compound/search/all?search=50-00-0&media=application/json&page=0&pagesize=1) for compound with registry number *50-00-0*
22 | ````
23 | curl -H "Accept:application/json" \
24 | "https://apps.ideaconsult.net/ambit2/query/compound/search/all?search=50-00-0&page=0&pagesize=1"
25 | ````
26 |
27 | [Search by SMILES](https://apps.ideaconsult.net/ambit2/query/compound/search/all?search=c1ccccc1&media=application/json&page=0&pagesize=1) for compound with [SMILES](http://en.wikipedia.org/wiki/Simplified_molecular-input_line-entry_system) *c1cccc1*
28 | ````
29 | curl -H "Accept:application/json" \
30 | "http://apps.ideaconsult.net:8080/ambit2/query/compound/search/all?search=c1ccccc1&page=0&pagesize=1"
31 | ````
32 |
33 | [Search by InChI](https://apps.ideaconsult.net/ambit2/query/compound/search/all?search=InChI%3D1%2FC2H6O%2Fc1-2-3%2Fh3H%2C2H2%2C1H3&media=application/json&page=0&pagesize=1) for compound with [InChI](http://en.wikipedia.org/wiki/International_Chemical_Identifier) *InChI=1/C2H6O/c1-2-3/h3H,2H2,1H3*
34 | ````
35 | curl -H "Accept:application/json" \
36 | "https://apps.ideaconsult.net/ambit2/query/compound/search/all?search=InChI%3D1%2FC2H6O%2Fc1-2-3%2Fh3H%2C2H2%2C1H3&page=0&pagesize=1"
37 | ````
38 |
39 | [Search by URI](https://apps.ideaconsult.net/ambit2/query/compound/search/allnlinks?search=https://apps.ideaconsult.net/ambit2/compound/1&media=application/json&page=0&pagesize=1) for compound with URI https://apps.ideaconsult.net/ambit2/compound/1
40 | ````
41 | curl -H "Accept:application/json" \
42 | "https://apps.ideaconsult.net/ambit2/query/compound/search/allnlinks?search=https://apps.ideaconsult.net/ambit2/compound/1&media=application/json&page=0&pagesize=1"
43 | ````
44 |
45 | #### Similarity search
46 | ````
47 | curl -H "Accept:application/json" \
48 | "http://host:port/ambit2/query/compound/search/all?search=caffeine&page=0&pagesize=1"
49 | ````
50 |
51 | Examples:
52 |
53 | [Compounds similar](https://apps.ideaconsult.net/ambit2/query/similarity?search=c1ccccc1&threshold=0.8&page=0&pagesize=100&media=application/json) to SMILES c1ccccc1 with Tanimoto distance>=0.8
54 | ````
55 | curl -H "Accept:application/json" \
56 | "https://apps.ideaconsult.net/ambit2/query/similarity?search=c1ccccc1&threshold=0.8&page=0&pagesize=100"
57 | ````
58 |
59 | #### Substructure search
60 | ````
61 | curl -H "Accept:application/json" \
62 | "http://host:port/ambit2/query/compound/search/all?search=caffeine&page=0&pagesize=1"
63 | ````
64 |
65 | Examples:
66 |
67 | [Compounds containing substructure](https://apps.ideaconsult.net/ambit2/query/smarts?search=c1ccccc1&page=0&pagesize=100&media=application/json) , specified by SMILES c1ccccc1
68 | ````
69 | curl -H "Accept:application/json" \
70 | "https://apps.ideaconsult.net/ambit2/query/smarts?search=c1ccccc1&page=0&pagesize=100"
71 | ````
72 |
--------------------------------------------------------------------------------
/ambit-json-docs/restpolicy.md:
--------------------------------------------------------------------------------
1 | ##Local Policy Administration Point
2 |
3 | [http://host:port/app/admin/restpolicy](http://host:port/app/admin/restpolicy)
4 |
5 | ### JSON
6 |
7 | ````json
8 | {
9 | "policy": [
10 | {
11 | "uri": "http://host:port/app/admin/restpolicy/1",
12 | "resource": "/model",
13 | "role": "ambit_admin",
14 | "methods": {
15 | "get": true,
16 | "post": true,
17 | "put": true,
18 | "delete": true
19 | }
20 | },
21 | {
22 | "uri": "http://host:port/app/admin/restpolicy/2",
23 | "resource": "/dataset",
24 | "role": "ambit_admin",
25 | "methods": {
26 | "get": true,
27 | "post": true,
28 | "put": true,
29 | "delete": true
30 | }
31 | }
32 | ]
33 | }
34 | ````
35 |
36 | ###REST Operations
37 |
38 | #### GET /admin/restpolicy
39 | Returns all policies (JSON as above)
40 |
41 | #### GET /admin/restpolicy/{id}
42 | Returns one policy (JSON as above).
43 |
44 | #### PUT /admin/restpolicy/{id}
45 | Updates one policy. Returns a task URI
46 |
47 | Expects Content-type:[application/x-www-form-urlencoded](http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.1) with the following fields (all fields optional, unspecified fields will not be updated):
48 |
49 | ````
50 |