Class: OpenTox::AlgorithmComparisonReport

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

Instance Attribute Summary

Attributes included from OpenTox

#metadata, #uri

Class Method Summary collapse

Methods included from OpenTox

#add_metadata, all, #delete, #initialize, #load_metadata, sign_in, text_to_html, #to_rdfxml

Class Method Details

.create(crossvalidation_uri_hash, params = {}, subjectid = nil, 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 ] }

Parameters:

  • crossvalidation (Hash)

    uri_hash, see example

  • params (Hash) (defaults to: {})

    addiditonal possible (ttest_significance, ttest_attributes, min_confidence, min_num_predictions, max_num_predictions)

  • subjectid (String, optional) (defaults to: nil)
  • waiting_task (OpenTox::Task, optional) (defaults to: nil)

    (can be a OpenTox::Subtask as well), progress is updated accordingly

Returns:



322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
# File 'lib/validation.rb', line 322

def self.create( crossvalidation_uri_hash, params={}, subjectid=nil, 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(",")
  params[:subjectid] = subjectid
  uri = RestClientWrapper.post(File.join(CONFIG[:services]["opentox-validation"],"/report/algorithm_comparison"),
    params, {}, waiting_task )
  AlgorithmComparisonReport.new(uri)
end

.find(uri, subjectid = nil) ⇒ OpenTox::CrossvalidationReport

finds AlgorithmComparisonReport via uri, raises error if not found

Parameters:

  • uri (String)
  • subjectid (String, optional) (defaults to: nil)

Returns:



295
296
297
298
299
300
# File 'lib/validation.rb', line 295

def self.find( uri, subjectid=nil )
  OpenTox::RestClientWrapper.get(uri,{:subjectid => subjectid})
  rep = AlgorithmComparisonReport.new(uri)
  rep.( subjectid )
  rep
end

.find_for_crossvalidation(crossvalidation_uri, subjectid = nil) ⇒ OpenTox::AlgorithmComparisonReport

finds AlgorithmComparisonReport for a particular crossvalidation

Parameters:

  • crossvalidation (String)

    uri

  • subjectid (String, optional) (defaults to: nil)

Returns:



306
307
308
309
310
# File 'lib/validation.rb', line 306

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