Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
ChEMBL REST Web Service API client, parser and container classes.
Ruby Shell
tree: 773a09e7b6

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
test
.document
.gitignore
.project
.travis.yml
Gemfile
Gemfile.lock
LICENSE.txt
README.md
Rakefile
VERSION
bio-chembl.gemspec

README.md

bio-chembl

Build Status

ChEMBL REST Web Service API client, parser and container classes.

REST API address

    BioChEMBL::REST::ChEMBL_URI.status
     #=> "http://www.ebi.ac.uk/chemblws/status/" 
    BioChEMBL::REST::ChEMBL_URI.compounds("CHEMBL1") 
     #=> "http://www.ebi.ac.uk/chemblws/compounds/CHEMBL1"
    BioChEMBL::REST::ChEMBL_URI.targets("CHEMBL2477") 
     #=> "http://www.ebi.ac.uk/chemblws/targets/CHEMBL2477"
    BioChEMBL::REST::ChEMBL_URI.assays("CHEMBL1217643") 
     #=> "http://www.ebi.ac.uk/chemblws/assays/CHEMBL1217643"

Get data in XML

    api = BioChEMBL::REST.new
    compound = api.compounds("CHEMBL1")
    targst   = api.targets("CHEMBL2477")
    assay    = api.assays("CHEMBL1217643")

Check the server status

   BioChEMBL::REST.up? #=> true/false

REST API client, parser and container: BioChEMBL::Compound

    cpd = BioChEMBL::Compound.find("CHEMBL1")
    cpd.chemblId #=> "CHEMBL1"
    cpd.slimes

    smiles = "CC(=O)CC(C1=C(O)c2ccccc2OC1=O)c3ccccc3"
    cpds = BioChEMBL::Compound.find_all_by_smiles(smiles)
    cpds = BioChEMBL::Compound.find_all_by_substructure(smiles)
    cpds = BioChEMBL::Compound.find_all_by_similarity(smiles + "/70")

    cpd.bioactivities[0].parent_compound.chemblId #=> "CHEMBL1"

    xml = BioChEMBL::REST.new.compounds("CHEMBL1") 
    cpd = BioChEMBL::Compound.parse_xml(xml)

REST API client, parser and container: BioChEMBL::Target

    target = BioChEMBL::Target.find("CHEMBL1785")
    target.chemblId #=> "CHEMBL1785"
    target.targetType #=> "PROTEIN"
    target.geneNames #=> "EDNRB; ETRB"

    BioChEMBL.to_array(target.geneNames) #=> ["EDNRB", "ETRB"]
    synonyms = BioChEMBL.to_array(target.synonyms)
    synosyms[0] #=> "Endothelin B receptor"

    target = BioChEMBL::Target.find_by_uniprot("Q13936")

    target.bioactivities[0].target.chemblId #=> "CHEMBL1785"

    xml = BioChEMBL::REST.new.targets("CHEMBL1785")     
    target = BioChEMBL::Target.parse_xml(xml)

REST API client, parser and container: BioChEMBL::Assay

    assay = BioChEMBL::Assay.find("CHEMBL1217643")
    assay.chemblId #=> "CHEMBL1217643"

    assay.bioactivities[0].assay.chemblId #=> "CHEMBL1217643"
    assay.bioactivities[0].target
    assay.bioactivities[0].parent_compound

    xml = BioChEMBL::REST.new.assays("CHEMBL1217643") 
    assay = BioChEMBL::Assay.parse_xml(xml)

Parser and container: BioChEMBL::Bioactivity

    cpd.bioactivities[0].parent_compound.chemblId
    target.bioactivities[0].target.chemblId
    assay.bioactivities[0].assay.chemblId
    assay.bioactivities[0].target
    assay.bioactivities[0].parent_compound

Note: this software is under active development!

Installation

    gem install bio-chembl

Usage

    require 'bio-chembl'

The API doc is online. For more code examples see the test files in the source tree.

Project home page

Information on the source tree, documentation, examples, issues and how to contribute, see

http://github.com/nakao/bio-chembl

The BioRuby community is on IRC server: irc.freenode.org, channel: #bioruby.

Todo list

  • BioChEMBL::Target.find_by_refesq method.
  • JSON output support (parser and address).
  • ChEMBL RDF support.
  • Local REST API server with local ChEMBL database.

Cite

If you use this software, please cite one of

Biogems.info

This Biogem is published at #bio-chembl

Copyright

Copyright (c) 2012 Mitsuteru Nakao. See LICENSE.txt for further details.

Something went wrong with that request. Please try again.