summaryrefslogtreecommitdiff
path: root/lib/algorithm.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/algorithm.rb
parent9f16c1ede56a95368044a333f716d09c0240e5ab (diff)
Passes tests in opentox-test
Diffstat (limited to 'lib/algorithm.rb')
-rw-r--r--lib/algorithm.rb16
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/algorithm.rb b/lib/algorithm.rb
index 7007e3a..43f7ede 100644
--- a/lib/algorithm.rb
+++ b/lib/algorithm.rb
@@ -3,20 +3,24 @@ module OpenTox
class Fminer < OpenTox
# Create a new dataset with BBRC features
- def self.create(training_dataset_uri)
- RestClient.post @@config[:services]["opentox-fminer"], :dataset_uri => training_dataset_uri
+ def self.create(params)
+ puts params[:dataset_uri]
+ uri = RestClient.post File.join(@@config[:services]["opentox-algorithm"],'fminer'), :dataset_uri => params[:dataset_uri]
+ print "fminer finsihed "
+ puts uri
+ uri
end
end
class Similarity < OpenTox
def self.tanimoto(dataset1,compound1,dataset2,compound2)
- RestClient.get File.join(@@config[:services]["opentox-dataset"], 'algorithm/tanimoto/dataset',dataset1.name,compound1.inchi,'dataset',dataset2.name,compound2.inchi)
+ RestClient.get File.join(@@config[:services]["opentox-algorithm"], 'tanimoto/dataset',dataset1.name,compound1.inchi,'dataset',dataset2.name,compound2.inchi)
end
def self.weighted_tanimoto(dataset1,compound1,dataset2,compound2)
# URI.escape does not work here
- uri = File.join(@@config[:services]["opentox-dataset"], 'algorithm/weighted_tanimoto/dataset',CGI.escape(dataset1.name),'compound',CGI.escape(compound1.inchi),'dataset',CGI.escape(dataset2.name),'compound',CGI.escape(compound2.inchi))
+ uri = File.join(@@config[:services]["opentox-algorithm"], 'weighted_tanimoto/dataset',CGI.escape(dataset1.name),'compound',CGI.escape(compound1.inchi),'dataset',CGI.escape(dataset2.name),'compound',CGI.escape(compound2.inchi))
RestClient.get uri
end
@@ -24,8 +28,8 @@ module OpenTox
class Lazar < OpenTox
# Create a new prediction model from a dataset
- def initialize(params)
- @uri = RestClient.post @@config[:services]["opentox-lazar"] + 'models' , :dataset_uri => params[:dataset_uri]
+ def self.create(params)
+ RestClient.post File.join(@@config[:services]["opentox-algorithm"],"lazar_classification"), params
end
end