summaryrefslogtreecommitdiff
path: root/lib/model.rb
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.ch>2010-10-22 17:45:19 +0200
committerChristoph Helma <helma@in-silico.ch>2010-10-22 17:45:19 +0200
commitd6811507c1c1339cc4fe7cdb429b9b34b97dc422 (patch)
tree9cf87802db0b03e078077a52ecedd0994bbbd0e4 /lib/model.rb
parent3dd19c461d0b205ff504a85785f0c6e55114cd4e (diff)
new API with support for external services (initial version)
Diffstat (limited to 'lib/model.rb')
-rw-r--r--lib/model.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/model.rb b/lib/model.rb
index 3ecd61c..d0d6703 100644
--- a/lib/model.rb
+++ b/lib/model.rb
@@ -84,8 +84,8 @@ module OpenTox
def initialize
@source = "http://github.com/helma/opentox-model"
- @algorithm = File.join(@@config[:services]["opentox-algorithm"],"lazar")
- #@independent_variables = File.join(@@config[:services]["opentox-algorithm"],"fminer#BBRC_representative")
+ @algorithm = File.join(CONFIG[:services]["opentox-algorithm"],"lazar")
+ #@independent_variables = File.join(CONFIG[:services]["opentox-algorithm"],"fminer#BBRC_representative")
@features = []
@effects = {}
@activities = {}
@@ -95,12 +95,12 @@ module OpenTox
def save
@features.uniq!
- resource = RestClient::Resource.new(@@config[:services]["opentox-model"])
+ resource = RestClient::Resource.new(CONFIG[:services]["opentox-model"])
resource.post(self.to_yaml, :content_type => "application/x-yaml").chomp.to_s
end
def self.find_all
- RestClientWrapper.get(@@config[:services]["opentox-model"]).chomp.split("\n")
+ RestClientWrapper.get(CONFIG[:services]["opentox-model"]).chomp.split("\n")
end
def self.predict(compound_uri,model_uri)
@@ -115,8 +115,8 @@ module OpenTox
def initialize
@source = "http://github.com/helma/opentox-model"
- @algorithm = File.join(@@config[:services]["opentox-algorithm"],"property_lazar")
- #@independent_variables = File.join(@@config[:services]["opentox-algorithm"],"fminer#BBRC_representative")
+ @algorithm = File.join(CONFIG[:services]["opentox-algorithm"],"property_lazar")
+ #@independent_variables = File.join(CONFIG[:services]["opentox-algorithm"],"fminer#BBRC_representative")
@features = []
#@effects = {}
@activities = {}
@@ -126,12 +126,12 @@ module OpenTox
def save
@features.uniq!
- resource = RestClient::Resource.new(@@config[:services]["opentox-model"])
+ resource = RestClient::Resource.new(CONFIG[:services]["opentox-model"])
resource.post(self.to_yaml, :content_type => "application/x-yaml").chomp.to_s
end
def self.find_all
- RestClientWrapper.get(@@config[:services]["opentox-model"]).chomp.split("\n")
+ RestClientWrapper.get(CONFIG[:services]["opentox-model"]).chomp.split("\n")
end
def self.predict(compound_uri,model_uri)