diff options
author | Christoph Helma <helma@in-silico.de> | 2009-11-23 18:17:37 +0100 |
---|---|---|
committer | Christoph Helma <helma@in-silico.de> | 2009-11-23 18:17:37 +0100 |
commit | adfcc9d572a2122b1b030dc04b3abf46007fb3f7 (patch) | |
tree | 6c0909cd433209c9e7b5ee0612814ce8cd8192b7 /lib/compound.rb | |
parent | 7d6ae04f8554e3aadfa9ae490445fe2a71a3307e (diff) |
RDF support added
Diffstat (limited to 'lib/compound.rb')
-rw-r--r-- | lib/compound.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/compound.rb b/lib/compound.rb index c4ba8d9..416acab 100644 --- a/lib/compound.rb +++ b/lib/compound.rb @@ -15,7 +15,7 @@ module OpenTox @inchi = params[:inchi] @uri = File.join(@@config[:services]["opentox-compound"],URI.escape(@inchi)) elsif params[:name] - @inchi = RestClient.get "#{@@cactus_uri}#{params[:name]}/stdinchi" + @inchi = RestClient.get("#{@@cactus_uri}#{params[:name]}/stdinchi").chomp @uri = File.join(@@config[:services]["opentox-compound"],URI.escape(@inchi)) elsif params[:uri] @inchi = params[:uri].sub(/^.*InChI/, 'InChI') @@ -44,8 +44,8 @@ module OpenTox end # Match an array of smarts features, returns matching features - def match(smarts_dataset) - smarts_dataset.all_features.collect{ |uri| uri if self.match?(Feature.new(:uri => uri).name) }.compact + def match(smarts_array) + smarts_array.collect{|s| s if match?(s)}.compact end def smiles2inchi(smiles) |