summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.ch>2010-07-14 13:56:50 +0200
committerChristoph Helma <helma@in-silico.ch>2010-07-14 13:56:50 +0200
commit3fe0e8c735abd2cacc138f075b5a4af0c6359724 (patch)
treeb3f2a28ed52e30582cfca94a4af1b6848b43cda7
parent0bbfb66685b9c647bc51dab432a63cb61114a697 (diff)
model creation working, validation report generation fails for large datasets
-rw-r--r--Rakefile3
-rw-r--r--lib/compound.rb13
-rw-r--r--lib/templates/config.yaml2
3 files changed, 13 insertions, 5 deletions
diff --git a/Rakefile b/Rakefile
index 39ec349..b6c6939 100644
--- a/Rakefile
+++ b/Rakefile
@@ -25,7 +25,8 @@ begin
"roo",
"spreadsheet",
"google-spreadsheet-ruby",
- "tmail"
+ "tmail",
+ "rinruby"
].each { |dep| gem.add_dependency dep }
[ "dm-core",
'dm-serializer',
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
diff --git a/lib/templates/config.yaml b/lib/templates/config.yaml
index dba0bf3..b367af3 100644
--- a/lib/templates/config.yaml
+++ b/lib/templates/config.yaml
@@ -30,7 +30,7 @@
opentox-algorithm: "http://localhost/algorithm/"
opentox-model: "http://localhost/model/"
opentox-task: "http://localhost/task/"
- opentox-validation: "http://opentox.informatik.uni-freiburg.de/validation/"
+ opentox-validation: "http://localhost/validation/"
#
# Accept headers:
#