Class: OpenTox::CrossvalidationReport

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, subjectid = nil, waiting_task = nil) ⇒ OpenTox::CrossvalidationReport

creates a crossvalidation report via crossvalidation

Parameters:

  • crossvalidation (String)

    uri

  • 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:



280
281
282
283
284
# File 'lib/validation.rb', line 280

def self.create( crossvalidation_uri, subjectid=nil, waiting_task=nil )
  uri = RestClientWrapper.post(File.join(CONFIG[:services]["opentox-validation"],"/report/crossvalidation"),
    { :validation_uris => crossvalidation_uri, :subjectid => subjectid }, {}, waiting_task )
  CrossvalidationReport.new(uri)
end

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

finds CrossvalidationReport via uri, raises error if not found

Parameters:

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

Returns:



258
259
260
261
262
263
# File 'lib/validation.rb', line 258

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

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

finds CrossvalidationReport for a particular crossvalidation

Parameters:

  • crossvalidation (String)

    uri

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

Returns:



269
270
271
272
273
# File 'lib/validation.rb', line 269

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