From adfcc9d572a2122b1b030dc04b3abf46007fb3f7 Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Mon, 23 Nov 2009 18:17:37 +0100 Subject: RDF support added --- lib/compound.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/compound.rb') 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) -- cgit v1.2.3