Class: OpenTox::AlgorithmComparisonReport

Inherits:
Object
  • Object
show all
Includes:
OldOpenTox
Defined in:
lib/validation.rb

Instance Attribute Summary

Attributes included from OldOpenTox

#metadata, #uri

Class Method Summary collapse

Methods included from OldOpenTox

#delete, #initialize, #load_metadata

Class Method Details

.create(crossvalidation_uri_hash, params = {}, waiting_task = nil) ⇒ OpenTox::AlgorithmComparisonReport

creates a algorithm comparison report via crossvalidation uris example for hash: { :lazar-bbrc => [ host/validation/crossvalidation/x1, host/validation/crossvalidation/x2 ],

:lazar-last => [ http://host/validation/crossvalidation/xy, http://host/validation/crossvalidation/xy ] }

328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
# File 'lib/validation.rb', line 328

def self.create( crossvalidation_uri_hash, params={}, waiting_task=nil )
  identifier = []
  validation_uris = []
  crossvalidation_uri_hash.each do |id, uris|
    uris.each do |uri|
      identifier << id
      validation_uris << uri
    end
  end
  params = {} if params==nil
  raise OpenTox::BadRequestError.new "params is no hash" unless params.is_a?(Hash)
  params[:validation_uris] = validation_uris.join(",")
  params[:identifier] = identifier.join(",")
  uri = RestClientWrapper.post(File.join($validation[:uri],"/report/algorithm_comparison"), params, {}, waiting_task )
  uri = wait_for_task(uri)
  AlgorithmComparisonReport.new(uri)
end

.find(uri) ⇒ OpenTox::CrossvalidationReport

finds AlgorithmComparisonReport via uri, raises error if not found


303
304
305
306
307
308
# File 'lib/validation.rb', line 303

def self.find( uri )
  OpenTox::RestClientWrapper.get(uri)
  rep = AlgorithmComparisonReport.new(uri)
  rep.
  rep
end

.find_for_crossvalidation(crossvalidation_uri) ⇒ OpenTox::AlgorithmComparisonReport

finds AlgorithmComparisonReport for a particular crossvalidation


313
314
315
316
317
# File 'lib/validation.rb', line 313

def self.find_for_crossvalidation( crossvalidation_uri )
  uris = RestClientWrapper.get(File.join($validation[:uri],
    "/report/algorithm_comparison?crossvalidation="+crossvalidation_uri)).chomp.split("\n")
  uris.size==0 ? nil : AlgorithmComparisonReport.new(uris[-1])
end