Class: OpenTox::QMRFReport

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

creates a qmrf report via model

Parameters:

  • model_uri (String)
  • 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:



370
371
372
373
374
# File 'lib/validation.rb', line 370

def self.create( model_uri, subjectid=nil, waiting_task=nil )
  uri = RestClientWrapper.post(File.join(CONFIG[:services]["opentox-validation"],"/reach_report/qmrf"), 
    { :model_uri => model_uri, :subjectid => subjectid }, {}, waiting_task )
  QMRFReport.new(uri)
end

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

finds QMRFReport, raises Error if not found

Parameters:

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

Returns:



349
350
351
352
353
# File 'lib/validation.rb', line 349

def self.find( uri, subjectid=nil )
  # PENDING load crossvalidation data?
  OpenTox::RestClientWrapper.get(uri,{:subjectid => subjectid})
  QMRFReport.new(uri)
end

.find_for_model(model_uri, subjectid = nil) ⇒ OpenTox::QMRFReport

finds QMRF report for a particular model

Parameters:

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

Returns:



359
360
361
362
363
# File 'lib/validation.rb', line 359

def self.find_for_model( model_uri, subjectid=nil )
  uris = RestClientWrapper.get(File.join(CONFIG[:services]["opentox-validation"],
    "/reach_report/qmrf?model="+model_uri), {:subjectid => subjectid}).chomp.split("\n")
  uris.size==0 ? nil : QMRFReport.new(uris[-1])
end