<commit_before># bio-unichem

[![Build Status](https://secure.travis-ci.org/nakao/bio-unichem.png)](http://travis-ci.org/nakao/bio-unichem)

BioRuby plugin for [UniChem REST Webservice](https://www.ebi.ac.uk/unichem/info/webservices).

REST API address
```ruby
   BioUniChem::REST::UniChem_URI.src_compound_id("CHEMBL12", "1", "2")
   #=> "http://www.ebi.ac.uk/unichem/rest/src_compound_id/CHEMBL12/1/2"
   
   BioUniChem::REST::UniChem_URI.mapping("4", "1")
   #=> "http://www.ebi.ac.uk/unichem/rest/mapping/4/1"
```

Get Data 
```ruby
   client = BioUniChem::REST.new
   result = client.src_compound_id("CHEMBL12", "1", "2")
   p result 
   #=> [{"src_compound_id"=>"DB00829"}]
```

Get Data by src_id Short name
```ruby
   client = BioUniChem::REST.new
   result = client.src_compound_id("CHEMBL12", BioUniChem.src_id(:chembl), BioUniChem.src_id(:drugbank))
   p result 
   #=> [{"src_compound_id"=>"DB00829"}]
```

The Ruby script bellow utilizes the Bio UniChem module
```ruby
   require 'bio-unichem'

   ## --------------------------
   ## create client ...
   client = BioUniChem::REST.new

   ## --------------------------
   ## get the data ...
   result = client.src_compound_id("CHEMBL12", "1")<commit_msg>Fixed<commit_after># bio-unichem

[![Build Status](https://secure.travis-ci.org/nakao/bio-unichem.png)](http://travis-ci.org/nakao/bio-unichem)

BioRuby plugin for [UniChem REST Webservice](https://www.ebi.ac.uk/unichem/info/webservices).

REST API address
```ruby
   BioUniChem::REST::UniChem_URI.src_compound_id("CHEMBL12", "1", "2")
   #=> "http://www.ebi.ac.uk/unichem/rest/src_compound_id/CHEMBL12/1/2"
   
   BioUniChem::REST::UniChem_URI.mapping("4", "1")
   #=> "http://www.ebi.ac.uk/unichem/rest/mapping/4/1"
```

Get Data 
```ruby
   client = BioUniChem::REST.new
   result = client.src_compound_id("CHEMBL12", "1", "2")
   p result 
   #=> [{"src_compound_id"=>"DB00829"}]
```

Get Data using [Source ID by Short name](https://www.ebi.ac.uk/unichem/ucquery/listSources)
```ruby
   client = BioUniChem::REST.new
   result = client.src_compound_id("CHEMBL12", BioUniChem.src_id(:chembl), BioUniChem.src_id(:drugbank))
   p result 
   #=> [{"src_compound_id"=>"DB00829"}]
```

The Ruby script bellow utilizes the Bio UniChem module
```ruby
   require 'bio-unichem'

   ## --------------------------
   ## create client ...
   client = BioUniChem::REST.new

   ## --------------------------
   ## get the data ...
   result = client.src_compound_id("CHEMBL12", "1")
{'fraction_non_alphanumeric': 0.22289156626506024, 'fraction_numerical': 0.024899598393574297, 'mean_word_length': 3.377855887521968, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 5, 'lorem ipsum': 0, 'www.': 7, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4949889', 'n_tokens_mistral': 1078, 'n_tokens_neox': 967, 'n_words': 143}