classyfire_api/README.md

81 lines
3.0 KiB
Markdown
Raw Normal View History

2014-07-09 23:02:34 +01:00
[**ClassyFire**](http://classyfire.wishartlab.com) is a resource that allows you to automatically classify any chemical compound based on its structure. This is the repository for the ClassyFire API allows you to send requests to and pull information from the ClassyFire web server.
2014-07-09 22:41:04 +01:00
2014-07-09 23:43:34 +01:00
# **What is this repository for?** #
2014-07-09 22:41:04 +01:00
* Quick summary
* Version
* [Learn Markdown](https://bitbucket.org/tutorials/markdowndemo)
2014-07-09 23:43:34 +01:00
# **How do I get set up?** #
2014-07-09 22:41:04 +01:00
* Summary of set up
* Configuration
* Dependencies
* Database configuration
* How to run tests
* Deployment instructions
2014-07-09 23:43:34 +01:00
# **Contribution guidelines** #
2014-07-09 22:41:04 +01:00
* Writing tests
* Code review
* Other guidelines
2014-07-09 23:32:43 +01:00
2014-07-09 23:42:11 +01:00
# **Endpoints** #
2014-07-10 04:10:33 +01:00
> ##1. Entity##
2014-07-10 05:01:56 +01:00
>
2014-07-10 03:47:02 +01:00
> >Chemical compounds are represented by the Entity model, through which one can access the compound's structure-based classification.
2014-07-10 04:10:33 +01:00
> >
> >###GET###
> >
> >**/entities/{entity_inchikey}**
> >
> >A chemical compound's classification can be retrieved in the JSON or XML format. The compound's information is accessed via the InChIkey as show in the following examples. In this example, the entity has the InChIKey=LABTWGUMFABVFG-ONEGZZNKSA-N.
2014-07-10 00:07:39 +01:00
> > >
2014-07-10 05:18:09 +01:00
> > >curl -H "Accept: application/json" -H "Content-Type: application/json" -X GET http://classyfire.wishartlab.com/entities/BDAGIHXWWSANSR-UHFFFAOYSA-N.json
2014-07-10 00:07:39 +01:00
> > >
2014-07-10 05:18:09 +01:00
> > >curl -H "Accept: application/xml" -H "Content-Type: application/xml" -X GET http://classyfire.wishartlab.com/entities/BDAGIHXWWSANSR-UHFFFAOYSA-N.xml
2014-07-10 00:07:39 +01:00
2014-07-10 04:10:33 +01:00
> ##2. Query##
2014-07-10 05:01:56 +01:00
>
2014-07-10 05:43:15 +01:00
> >The Query model represents the chemical structure to be classified. Its attributes are the query label and the query input.
> > >The query label is an identifier
> > >
> > > The query input contains the compound's identifier (optional) and its structural representation, separated by a comma. The chemical structure is represented either in the [Daylight SMILES](http://www.daylight.com/dayhtml/doc/theory/theory.smiles.html) or the [InChI](http://www.iupac.org/home/publications/e-resources/inchi.html) format.
2014-07-10 05:01:56 +01:00
> >
2014-07-10 04:10:33 +01:00
> >###POST###
> >A query can be submitted using the POST method as demonstrated in the following example.
2014-07-10 05:18:09 +01:00
> > >curl -d "query[label]=curl_test&query[query_input]=ID1,C(=O)O&submit=Submit query" http://classyfire.wishartlab.com/queries/
2014-07-10 05:43:15 +01:00
> >
2014-07-10 05:12:01 +01:00
> >where the parameters are:
2014-07-10 05:43:15 +01:00
> >
2014-07-10 05:44:17 +01:00
> > >The query label: curl_test,
2014-07-10 05:43:15 +01:00
> > >
2014-07-10 05:44:17 +01:00
> > >The entity identifier: ID1,
2014-07-10 05:43:15 +01:00
> >
2014-07-10 05:44:17 +01:00
> > >The entity's structure represented in the SMILES format: C(=O)O.
2014-07-10 05:01:56 +01:00
> >
2014-07-10 04:10:33 +01:00
> >###GET###
2014-07-10 05:12:01 +01:00
> >
> >**/queries/{query_id}**
> >
2014-07-10 20:20:05 +01:00
> >The classification results can be retrieved via a GET method in the JSON or XML format.
> > >
2014-07-10 05:18:09 +01:00
> > >curl -H "Accept: application/json" -H "Content-Type: application/json" -X GET http://classyfire.wishartlab.com/queries/88.json
2014-07-10 05:43:15 +01:00
> >
2014-07-10 05:18:09 +01:00
> > >curl -H "Accept: application/json" -H "Content-Type: application/json" -X GET http://classyfire.wishartlab.com/queries/88.xml
2014-07-10 20:20:05 +01:00
> >
> >where the query id is 88.
2014-07-10 03:47:02 +01:00
2014-07-09 23:43:34 +01:00
# **Directory Structure** #
2014-07-09 22:41:04 +01:00
2014-07-09 23:39:28 +01:00
* lib
2014-07-09 23:35:05 +01:00
2014-07-09 23:43:34 +01:00
# **Who do I talk to?** #
2014-07-09 22:41:04 +01:00
* Repo owner or admin
* Other community or team contact