From 64354959e04fcac11bcf70e75099691b74573033 Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Tue, 16 Aug 2011 14:46:31 +0200 Subject: initial minimal version --- lib/algorithm.rb | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'lib/algorithm.rb') diff --git a/lib/algorithm.rb b/lib/algorithm.rb index 2652695..4c50d32 100644 --- a/lib/algorithm.rb +++ b/lib/algorithm.rb @@ -1,8 +1,8 @@ # R integration # workaround to initialize R non-interactively (former rinruby versions did this by default) # avoids compiling R with X -R = nil -require "rinruby" +#R = nil +#require "rinruby" module OpenTox @@ -16,6 +16,7 @@ module OpenTox # @param [optional,OpenTox::Task] waiting_task (can be a OpenTox::Subtask as well), progress is updated accordingly # @return [String] URI of new resource (dataset, model, ...) def run(params=nil, waiting_task=nil) + #puts @uri RestClientWrapper.post(@uri, params, {:accept => 'text/uri-list'}, waiting_task).to_s end @@ -37,7 +38,7 @@ module OpenTox def self.find(uri, subjectid=nil) return nil unless uri alg = Generic.new(uri) - alg.load_metadata( subjectid ) + alg.load_metadata raise "cannot load algorithm metadata" if alg.metadata==nil or alg.metadata.size==0 alg end @@ -54,7 +55,7 @@ module OpenTox # Initialize bbrc algorithm def initialize(subjectid=nil) super File.join(CONFIG[:services]["opentox-algorithm"], "fminer/bbrc") - load_metadata(subjectid) + load_metadata end end @@ -64,7 +65,7 @@ module OpenTox # Initialize last algorithm def initialize(subjectid=nil) super File.join(CONFIG[:services]["opentox-algorithm"], "fminer/last") - load_metadata(subjectid) + load_metadata end end @@ -76,10 +77,11 @@ module OpenTox # Initialize lazar algorithm def initialize(subjectid=nil) super File.join(CONFIG[:services]["opentox-algorithm"], "lazar") - load_metadata(subjectid) + load_metadata end end +=begin # Utility methods without dedicated webservices # Similarity calculations @@ -399,6 +401,7 @@ module OpenTox m_pos = array.size / 2 return array.size % 2 == 1 ? array[m_pos] : (array[m_pos-1] + array[m_pos])/2 end +=end end end -- cgit v1.2.3