Skip to content

helma/lazar-webservice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LAZAR-WEBSERVICE

This is an example OpenTox webservice for the lazar prediction system and public data from the DSSTOX project.

REST API

Description Method URI Parameters
List all models GET /models
Show a single model GET /models/{id}
Predict smiles GET /models/{id} smiles
Create a model POST /models structure_file, activity_file, username, password
Delete a model PUT /models/{id} username, password

Return values

Success: XML file with requested information
Failure: Text with error description

Input file format

To create a model you have to POST files with training data. Both input files should have 2 columns, delimited by a tab or whitespaces. No headers are allowed.

structure_file:

First column: (Unique) compound ID
Second column: Smiles string (structure_file)

activity_file:

First column: Compound ID
Second column: Toxic activity (1 (active) or 0 (inactive) for classification)
Note: numerical values for regression problems will be supported in a future version

You can provide more than one activity per compound ID (for replicated experiments). Activites without structures and structures without activities will be ignored.

Examples

Display all available models

curl -X GET http://localhost:3000/models

Display information for a single model

curl -X GET http://localhost:3000/models/1

Note: Detailed model annotations (data sources, endpoint definitions, validation results, …) will be provided by a separate component.

Predict rodent carcinogenicity (CPDB multi_cell_call) for Aniline

curl -X GET http://localhost:3000/models/1?smiles=c1cccc1N

Important: Smiles strings have to be URL encoded!

Create a new prediction model for hamster carcinogenicity

curl -X POST -F structure_file=hamster_carcinogenicity.smi -F activity_file=hamster_carcinogenicity.class -F username=secret -F password=secret http://localhost:3000/models

Delete a model

curl -X DELETE -d username=secret -d password=secret http://localhost:3000/models/1

Error codes

200 OK
404 Not Found
500 Internal Server Error
503 Service Unavailable

Installation

  • Get the source code for the webservice

git clone git://github.com/helma/lazar-webservice.git

  • Install lazar-core and prepare the lazar webservice


cd lazar-webservice
rake lazar:setup

If lazar-core does not compile

* Make sure, that you have the development libraries Swig, GSL, Boost, OpenBabel, R installed
* Configure R with ./configure --without-blas --enable-BLAS-shlib --enable-R-shlib
* Install the R kernlab package:


wget http://cran.r-project.org/src/contrib/kernlab_0.9-8.tar.gz
R CMD INSTALL kernlab_0.9-8.tar.gz

* Check the paths in the Makefile of lib/lazar-core and adjust them to your system settings

  • Start the service

script/server

Now you should be able to contact localhost:3000 and use the REST API.

About

DEPRECATED (use opentox-algorithm/opentox-model instead)

:

Resources

License

Stars

Watchers

Forks

Packages

No packages published