summaryrefslogtreecommitdiff
path: root/lib/compound.rb
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.de>2009-10-06 10:39:43 +0200
committerChristoph Helma <helma@in-silico.de>2009-10-06 10:39:43 +0200
commit5d5688fbe43806af8523e5481715b5969feeab60 (patch)
treec5b2d26cbc2a2ebffa4606dfded62afd6d4c5821 /lib/compound.rb
parent9f16c1ede56a95368044a333f716d09c0240e5ab (diff)
Passes tests in opentox-test
Diffstat (limited to 'lib/compound.rb')
-rw-r--r--lib/compound.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/compound.rb b/lib/compound.rb
index 67c8004..c4ba8d9 100644
--- a/lib/compound.rb
+++ b/lib/compound.rb
@@ -10,13 +10,13 @@ module OpenTox
@@cactus_uri="http://cactus.nci.nih.gov/chemical/structure/"
if params[:smiles]
@inchi = smiles2inchi(params[:smiles])
- @uri = File.join(@@config[:services]["opentox-dataset"],"compound",@inchi)
+ @uri = File.join(@@config[:services]["opentox-compound"],URI.escape(@inchi))
elsif params[:inchi]
- @inchi = inchi
- @uri = File.join(@@config[:services]["opentox-dataset"],"compound",@inchi)
+ @inchi = params[:inchi]
+ @uri = File.join(@@config[:services]["opentox-compound"],URI.escape(@inchi))
elsif params[:name]
@inchi = RestClient.get "#{@@cactus_uri}#{params[:name]}/stdinchi"
- @uri = File.join(@@config[:services]["opentox-dataset"],"compound",@inchi)
+ @uri = File.join(@@config[:services]["opentox-compound"],URI.escape(@inchi))
elsif params[:uri]
@inchi = params[:uri].sub(/^.*InChI/, 'InChI')
@uri = params[:uri]