REST Web Services
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


A collection of mod_python based REST services. Many of these services
are actually simple front ends to other SOAP based web services. While
the code can be downloaded and run from any machine (with mod_python
and Apache) they will be dependent on remote SOAP services.

* format

Requires that OpenBabel and its Python bindings be installed

* substruct

Requires that OpenBabel and its Python bindings be installed

Supports GET or POST requests. If the former then the URL should be of the form


where TARGET is a SMILES string for the target molecule and QUERY is a SMARTS
(or SMILES) pattern. Both arguments should be appropriately escaped. The return 
value is either the string "true" or "false" if the query matches the pattern

If a POST request is recieved then the service expects two form variables:

  - query - a single string containing the SMARTS pattern
  - target - a comma separated string of one or more SMILES strings

The return value will be a multiline plain text document. The number of
lines equals the number of input SMILES. Each line is either "true", "false"
or "fail". Thus if the i'th row is "true", the i'th target molecule contained the 
query. The string "fail" implies that there was an error parsing the SMILES

* predict
Requrements: Python 2.4 or better
	     R 2.7.2 or better

Dependency : descriptor service
Services that will use R via rpy2 to obtain predictions from
previously built statisticalk models. These services are oriented
to QSAR models, so the input to these services is usually a Base64
encoded SMILES string.

The entry point to this service is which investigates the
URL to identify which model is to be used to obtain predictions. To
obtain a list of models visit the URL (return type is text/plain)


To get the details of a model (return type is text/xml), visit


To obtain a prediction from a model, visit


where SMILES should be the Base64 encoded SMILES string. If an invalid
model name is specified, a HTTP 404 error is returned.

Each model should be stored in a Rda file (use "save" in
R). Currently, only models that have an associated "predict" method
are considered. Furthermore, the file should have a single model
object called "model". This is currently a bit restrictive and future
versions will probably encode the name of the model object in the

The service can handle multiple models via a model manifest. This is
an XML document, listing the details of one or more models and is
shown schematically below:

  <model title="A model title" name="ModelName" rda="theModel.Rda">
    <author>The Modeler</author>
    <description>A description of the model</description>	
      <descriptor class="xxx" value="xxx" />
      <descriptor class="xxx" value="xxx" />
      <descriptor class="xxx" value="xxx" />
  <model ... >

Essentially the manifest describes the descriptors required for the
model, along with other details such as the Rda file containing the
model. Right now only CDK descriptors are supported and are accessed
via the descriptor REST service. The _class_ attribute should be the fully
qualified class name of the descriptor and _value_ should be the name
of the specific descriptor value employed in the model. See

for a list of descriptors and their individual values.