Class: OpenTox::AlgorithmComparisonReport
- Inherits:
-
Object
- Object
- OpenTox::AlgorithmComparisonReport
- Includes:
- OpenTox
- Defined in:
- lib/validation.rb
Instance Attribute Summary
Attributes included from OpenTox
Class Method Summary collapse
-
.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 => [ host/validation/crossvalidation/xy, host/validation/crossvalidation/xy ] }.
-
.find(uri, subjectid = nil) ⇒ OpenTox::CrossvalidationReport
finds AlgorithmComparisonReport via uri, raises error if not found.
-
.find_for_crossvalidation(crossvalidation_uri, subjectid = nil) ⇒ OpenTox::AlgorithmComparisonReport
finds AlgorithmComparisonReport for a particular crossvalidation.
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 ] }
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
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
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 |