bio-unichem

Build Status

BioRuby plugin for UniChem REST Web service.

REST API address

   Bio::UniChem::REST::UniChem_URI.src_compound_id("CHEMBL12", "1", "2")
   #=> "http://www.ebi.ac.uk/unichem/rest/src_compound_id/CHEMBL12/1/2"

   Bio::UniChem::REST::UniChem_URI.mapping("4", "1")
   #=> "http://www.ebi.ac.uk/unichem/rest/mapping/4/1"

Get Data

   client = Bio::UniChem::REST.new
   result = client.src_compound_id("CHEMBL12", "1", "2")
   p result 
   #=> [{"src_compound_id"=>"DB00829"}]

Get Data using Source ID by Short name

   client = Bio::UniChem::REST.new
   result = client.src_compound_id("CHEMBL12", 
                                   Bio::UniChem::Sources['chembl'].src_id, 
                                   Bio::UniChem::Sources['drugbank'].src_id)
   p eresult 
   #=> [{"src_compound_id"=>"DB00829"}]

Sources and Souece models list of sources

   chembl = Bio::UniChem::Sources['chembl']
   chembl.src_id
   #=> "1"
   chembl.short_name
   #=> "chembl"
   chembl.full_name
   #=> "ChEMBL"

The Ruby script bellow utilizes the Bio UniChem module

   require 'bio-unichem'

   ## --------------------------
   ## create client ...
   client = Bio::UniChem::REST.new

   ## --------------------------
   ## get the data ...
   result = client.src_compound_id("CHEMBL12", Bio::UniChem::Sources["chembl"].src_id)

   ## --------------------------
   ## print ...
   p result   

Note: this software is under active development!

Installation

    gem install bio-unichem

Usage

    require 'bio-unichem'

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-unichem

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

Cite

If you use this software, please cite one of

Biogems.info

This Biogem is published at #bio-unichem

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