[**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, which allows you to send requests to and pull information from the ClassyFire web server.
This ClassyFire API currently requires a version of the `rest-client` gem prior to v2. In order to use the commands below in a Ruby console, first run e.g.
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 tab. The chemical structure is represented either in the [Daylight SMILES](http://www.daylight.com/dayhtml/doc/theory/theory.smiles.html) format, the [InChI](http://www.iupac.org/home/publications/e-resources/inchi.html) format. Moreover, the compound can be represented with its [IUPAC name](http://www.chem.qmul.ac.uk/iupac/).
The input can also be of type [FASTA](https://en.wikipedia.org/wiki/FASTA_format), which contains peptide or nucleotide sequences.
###POST###
A query can be submitted using the POST method as demonstrated in the following example.
Chemical compounds are represented by the Entity model, through which one can access the compound's structure-based classification.
###GET###
**/entities/{entityInchikey}**
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.
* The entity's InChIKey is "BDAGIHXWWSANSR-UHFFFAOYSA-N",
* The output format is "json" (JSON).
##3. Sequence##
Sequences are represented by the Sequence model, through which one can access the compound's structure-based classification.
###GET###
**/sequence/{fingerprint}**
A (FASTA) sequence's classification can be retrieved in the JSON. In this example, the sequence has the fingerprint = "8bf70c23ac100cd2c3955081d8613325"
* The sequence's fingerprint is "8bf70c23ac100cd2c3955081d8613325",
* The fingerprint is generate by Digest::MD5 from the peptide sequence "APDVQDCPECTLQENPFFSQPGAPILQCMGCCFSRAYPTPLRSKKTMLVQKNVTSESTCCVAKSYNRVTVMGGFKVENHTACHCSTCYYHKS"