diff options
author | Christoph Helma <helma@in-silico.ch> | 2010-07-14 13:56:50 +0200 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2010-07-14 13:56:50 +0200 |
commit | 3fe0e8c735abd2cacc138f075b5a4af0c6359724 (patch) | |
tree | b3f2a28ed52e30582cfca94a4af1b6848b43cda7 /lib/compound.rb | |
parent | 0bbfb66685b9c647bc51dab432a63cb61114a697 (diff) |
model creation working, validation report generation fails for large datasets
Diffstat (limited to 'lib/compound.rb')
-rw-r--r-- | lib/compound.rb | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/compound.rb b/lib/compound.rb index 7c7c3d8..a293df0 100644 --- a/lib/compound.rb +++ b/lib/compound.rb @@ -1,3 +1,6 @@ +@@cactus_uri="http://cactus.nci.nih.gov/chemical/structure/" +@@ambit_uri="http://ambit.uni-plovdiv.bg:8080/ambit2/depict/cdk?search=" + module OpenTox class Compound #< OpenTox @@ -6,7 +9,6 @@ module OpenTox # Initialize with <tt>:uri => uri</tt>, <tt>:smiles => smiles</tt> or <tt>:name => name</tt> (name can be also an InChI/InChiKey, CAS number, etc) def initialize(params) - @@cactus_uri="http://cactus.nci.nih.gov/chemical/structure/" if params[:smiles] @inchi = smiles2inchi(params[:smiles]) @uri = File.join(@@config[:services]["opentox-compound"],URI.escape(@inchi)) @@ -45,12 +47,17 @@ module OpenTox obconversion(@inchi,'inchi','sdf') end - def image + def gif RestClientWrapper.get("#{@@cactus_uri}#{@inchi}/image") end + def png + RestClientWrapper.get("#{@@ambit_uri}#{smiles}") + end + def image_uri - "#{@@cactus_uri}#{@inchi}/image" + "#{@@ambit_uri}#{smiles}" + #"#{@@cactus_uri}#{@inchi}/image" end # Matchs a smarts string |