Class | OpenTox::Compound |
In: |
lib/opentox-ruby-api-wrapper.rb
|
Parent: | OpenTox |
Initialize with :uri => uri, :smiles => smiles or :name => name (name can be also an InChI/InChiKey, CAS number, etc)
# File lib/opentox-ruby-api-wrapper.rb, line 18 def initialize(params) if params[:uri] @uri = params[:uri].to_s elsif params[:smiles] @uri = RestClient.post ENV['OPENTOX_COMPOUNDS'] ,:smiles => uri_escape(params[:smiles]) elsif params[:name] @uri = RestClient.post ENV['OPENTOX_COMPOUNDS'] ,:name => uri_escape(params[:name]) end end
Match an array of smarts features, returns matching features
# File lib/opentox-ruby-api-wrapper.rb, line 43 def match(smarts_features) smarts_features.collect{ |smarts| smarts if self.match?(smarts.name) }.compact end