public
Description: DEPRECATED (use opentox-algorithm/opentox-model instead)
Homepage: :
Clone URL: git://github.com/helma/lazar-webservice.git
name age message
file .gitignore Loading commit data...
file .gitmodules Fri May 08 08:22:38 -0700 2009 lazar submodule removed [Christoph Helma]
file LICENSE Mon Aug 18 06:00:13 -0700 2008 initial import of lazar-gui [Christoph Helma]
file README.textile
file Rakefile Mon Aug 18 06:00:13 -0700 2008 initial import of lazar-gui [Christoph Helma]
directory app/
directory config/
directory db/ Fri May 08 10:07:11 -0700 2009 configuration for production environment [Christoph Helma]
directory doc/ Wed Sep 24 03:23:50 -0700 2008 doc/README_FOR_APP symbolic link to README.rdoc [Christoph Helma]
directory lib/
directory public/ Fri May 08 09:38:58 -0700 2009 rake task for application setup [Christoph Helma]
directory script/ Wed May 06 06:07:28 -0700 2009 obsolete files removed [Christoph Helma]
directory test/ Mon Aug 18 06:00:13 -0700 2008 initial import of lazar-gui [Christoph Helma]
README.textile

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.