Message-ID: <1353386048.171.1632427504472.JavaMail.bigchem@cpu> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_170_1460760799.1632427504471" ------=_Part_170_1460760799.1632427504471 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
You can run predictions on OCHEM using simple REST-like web services.
=20 =20 =20
To predict a molecule, run the following request (as example):
https://= ochem.eu/modelservice/getPrediction.do?modelId=3D1&mol=3Dc1ccccc1 <= /strong>
It will predict mutagenicity of benzene (c1ccccc1 is MOLECULE) using the AMES model https://ochem.eu/mode=
l/1 (1 is MODEL_ID)
In general your request should have form https://ochem.eu/modelservice/getPred=
iction.do?modelId=3DMODEL_ID&mol=3DMOLECULE where
The MOLECULE can be in SMILES or SD format. For both th=
e formats, multiple molecules can be posted using $$$$ separator.
It i=
s much more efficient to predict molecules in batches rather than =
posting separate tasks for each molecule.
The resulting JSON will look like:
{ "status" : "pending", "taskId" : 0, "metaserverTaskId" : 0 }=20
The above response means that this molecule is new and it is being calcu= lated at the moment.
Please, repeat the request at the periodic intervals (every 5-10 seconds= ) until the prediction result is returned in the following format:
{ "taskId": "0", =09=09// Array of predictions (for each input molecule) "predictions": [{ "moleculeID": "1002136505", =20 // Array of predictions for a given molecule. Normally, contain= s only one prediction.=20 // Can contain multiple predictions for multi-models "predictions": [{ "unit": "-log(mmol/L)", // Name of the predicted class for classification models. S= ame as "value" for regression models. =20 "predictedValueString": "2.71",=20 "value": "2.71", // Prediction value (r= ound it as you find necessary) "dm": "0.86", // The "distance to = model" used for the accuracy estimation =09=09=09=09"insideAD" : true, // is this molecule inside the mod= el's applicability domain? =09=09=09=09"property": "log(IGC50-1)", // The pr= edicted property "accuracy": "0.70", // The prediction a= ccuracy (RMSE) "realValue": "0.0" }], "depictionID": "1000651576" }], "metaserverTaskId": "0", "status": "success", "modelDescriptionUrl": "http://ochem.eu/model/3"= ; }=20
Since a prediction is not instantaneous and can take several seconds to = minutes, the prediction is performed asynchronously, that is in two steps:<= /p>
The API for these two simple steps is described below.
To post a task, run the following request:
htt= ps://ochem.eu/modelservice/postModel.do?modelId=3DYOUR_MODEL_ID&mol=3DY= OUR_MOLECULE
The resulting JSON will look like:
{ "taskId": "1000042989", // This is the task ID you= need to know "metaserverTaskId": "-1", "status": "success" }=20
Given that the result.modelResponse.status is "suc= cess", the task ID used for retrieving the predictions is resu= lt.modelResponse.taskId
To fetch the model, use the following request:
http://ochem.eu/modelservice/= fetchModel.do?taskId=3DYOUR_TASK_ID
If the task is still running, the resulting JSON will look like:
{ =20 "taskId": "0", "metaserverTaskId": "0", "status": "pending" // Keep requesting at periodic= intervals, while the status is "pending" =20 }=20
When the task is ready, the JSON will look like:
{ "taskId": "0", =09=09// Array of predictions (for each input molecule) "predictions": [{ "moleculeID": "1002136505", =20 // Array of predictions for a given molecule. Normally, contain= s only one prediction.=20 // Can contain multiple predictions for multi-models "predictions": [{ "unit": "-log(mmol/L)", // Name of the predicted class for classification models. S= ame as "value" for regression models. =20 "predictedValueString": "2.71",=20 "value": "2.71", // Prediction value (r= ound it as you find necessary) "dm": "0.86", // The "distance to = model" used for the accuracy estimation "property": "log(IGC50-1)", // The pred= icted property "accuracy": "0.70", // The prediction a= ccuracy (RMSE) "realValue": "0.0" }], "depictionID": "1000651576" }], "metaserverTaskId": "0", "status": "success", "modelDescriptionUrl": "http://ochem.eu/model/3"= ; }=20