summaryrefslogtreecommitdiff
path: root/lib/algorithm.rb
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.de>2009-12-14 09:41:59 +0100
committerChristoph Helma <helma@in-silico.de>2009-12-14 09:41:59 +0100
commitfc3bda0095ca7e6968edf01bec034a243d294af4 (patch)
tree6721d1130308ec1543d18acab9610860b6fe116f /lib/algorithm.rb
parentadfcc9d572a2122b1b030dc04b3abf46007fb3f7 (diff)
Initial adaptation to RDF/OWL
Diffstat (limited to 'lib/algorithm.rb')
-rw-r--r--lib/algorithm.rb52
1 files changed, 27 insertions, 25 deletions
diff --git a/lib/algorithm.rb b/lib/algorithm.rb
index 43f7ede..a32a462 100644
--- a/lib/algorithm.rb
+++ b/lib/algorithm.rb
@@ -1,35 +1,37 @@
module OpenTox
module Algorithm
- class Fminer < OpenTox
- # Create a new dataset with BBRC features
- 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 Fminer #< OpenTox
+ include Owl
- class Similarity < OpenTox
-
- def self.tanimoto(dataset1,compound1,dataset2,compound2)
- RestClient.get File.join(@@config[:services]["opentox-algorithm"], 'tanimoto/dataset',dataset1.name,compound1.inchi,'dataset',dataset2.name,compound2.inchi)
+ def initialize
+ super
+ self.uri = File.join(@@config[:services]["opentox-algorithm"],'fminer')
+ self.title = "fminer"
+ self.source = "http://github.com/amaunz/libfminer"
+ self.parameters = {
+ "Dataset URI" => { :scope => "mandatory", :value => "dataset_uri" },
+ "Feature URI for dependent variable" => { :scope => "mandatory", :value => "feature_uri" }
+ }
end
-
- def self.weighted_tanimoto(dataset1,compound1,dataset2,compound2)
- # URI.escape does not work here
- 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
-
end
- class Lazar < OpenTox
- # Create a new prediction model from a dataset
- def self.create(params)
- RestClient.post File.join(@@config[:services]["opentox-algorithm"],"lazar_classification"), params
+ class Lazar #< OpenTox
+ include Owl
+
+ def initialize
+ super
+ self.uri = File.join(@@config[:services]["opentox-algorithm"],'lazar')
+ self.title = "lazar"
+ self.source = "http://github.com/helma/opentox-algorithm"
+ self.parameters = {
+ "Dataset URI" =>
+ { :scope => "mandatory", :value => "dataset_uri" },
+ "Feature URI for dependent variable" =>
+ { :scope => "mandatory", :value => "feature_uri" },
+ "Feature generation URI" =>
+ { :scope => "mandatory", :value => "feature_generation_uri" }
+ }
end
end