REST Interfaces
Introduction
Representational State Transfer (REST) is a software architectural style that defines how arbitrary resources are defined and accessed in a network environment. It was first described by Roy Fielding in his Ph.D. dissertation. Though this approach is quite general, concrete implementations usually describe an HTTP interface, where a resource is defined by a traditional URL. The advantage of a REST interface to a service or resource is the ease with which they can be accessed and manipulated, without requiring extra layers of protocol (such as SOAP).We are slowly providing REST interfaces to our web services and this page will be updated as more interfaces are made available. Note, that the REST interface does not necessarily replace a SOAP based web service (indeed, our interfaces are wrappers around the pre-existing services). Rather, they provide an alternate mode of access to methods and data.
Databases
We have a number of databases derived from PubChem as well as a local mirror (updated monthly) of PubChem itself. At this point we provide REST interfaces to retrieve a compound ID (CID) given an InChI or an InChI key from our local PubChem mirror. To get a CID by InChI use the followinghttp://www.chembiogrid.org/cheminfo/rest/db/pubchem/cidinchi/InChI=1/C9H8O4/c1-6(10)13-8-5-3-2-4-7(8)9(11)12/h2-5H,1H3,(H,11,12)/f/h11Hand to get CID by InChI key use the following
http://rguha.ath.cx/~rguha/cicc/rest/db/pubchem/cidikey/RYYVLZVUVIJVGH-UHFFFAOYAWIn both the above URL's replace the component after
cidinchi or cidikey with your own
strings. If an invalid identifier is supplied you get a HTTP
404 error.
We currently provide access to our 3D structure database (Pub3D). The
database contains single conformer (but not necessarily
minimum energy) structures for 99% of PubChem and can be
accessed via SOAP web
services.
To obtain a 3D structure in SDF format for a given CID,
InChI or InChI key, use the following URL (using CID 2244 as an example)
http://www.chembiogrid.org/cheminfo/rest/db/pub3d/2244or
http://www.chembiogrid.org/cheminfo/rest/db/pub3d/InChI=1/C9H8O4/c1-6(10)13-8-5-3-2-4-7(8)9(11)12/h2-5H,1H3,(H,11,12)/f/h11Hor
http://www.chembiogrid.org/cheminfo/rest/db/pub3d/AMITWKPSRSBCJV-UHFFFAOYALIn case an invalid or non-existent CID or InChI is specified, an HTTP 404 is returned.
Cheminformatics
Currently we provide access to descriptor calculations and specifications for CDK descriptors using a REST interface.- Descriptors - In REST terminology we provide two
resources, viz., descriptor values for a given molecule (defined by
SMILES) and descriptor information.
To obtain information on all available descriptors use the following URLhttp://www.chembiogrid.org/cheminfo/rest/desc/descriptors
This returns an XML document containging multiple specification-ref elements, whose href attribute is a link that will provide the details for that individual descriptor
To calculate descriptor values for a SMILES string, simply append the SMILES string to the URL. For examplehttp://www.chembiogrid.org/cheminfo/rest/desc/descriptors/c1ccccc1COCC
This URL will return a similar document to that described above. In this case it will contain multiple descriptor-ref elements, whose href attribute is a link to a document that will contain the descriptor values. Since a given descriptor may have multiple values, the descriptor value document is also a simple XML document, containing descriptor names and corresponding values. For example visithttp://www.chembiogrid.org/cheminfo/rest/desc/descriptors/org.openscience.cdk.qsar.descriptors.molecular.ALOGPDescriptor/c1ccccc1COCC
- Depictions - It is also possible to obtain a 2D depiction
of a SMILES string via a REST interface (though I think this does
not strictly adhere to the REST principles, since the URL suggests
an action). However it allows you to easily construct URL's that
will return an image when viewed
http://www.chembiogrid.org/cheminfo/rest/depict/c1ccccc1C(=O)CN(C)(C)
- Format Conversion - We provide a simple REST style format
conversion service which uses OpenBabel
internally. Right now the service is restricted to SMILES as input
and one of sdf, InChI or InChI Key output. Example
URL's are
http://www.chembiogrid.org/cheminfo/rest/format/sdf/c1ccccc1C(=O)CN(C)(C) http://www.chembiogrid.org/cheminfo/rest/format/inchi/c1ccccc1C(=O)CN(C)(C) http://www.chembiogrid.org/cheminfo/rest/format/inchikey/c1ccccc1C(=O)CN(C)(C)
By restricting input to SMILES, the service is somewhat limited. However it does provide an easy way to get a InChI or InChI key representation of a molecule, which could then be used with other services


