Module: OpenTox::Algorithm

Includes:
OpenTox
Included in:
Descriptor, Fminer, Generic, Model::Generic
Defined in:
lib/algorithm.rb

Overview

Wrapper for OpenTox Algorithms

Defined Under Namespace

Classes: Descriptor, Fminer, Generic

Constant Summary

Constants included from OpenTox

AA

Instance Attribute Summary

Attributes included from OpenTox

#metadata, #parameters, #uri

Instance Method Summary collapse

Methods included from OpenTox

#[], #[]=, #cancelled?, #code, #completed?, #create_rdf, #delete, #error?, #error_report, #get, included, #initialize, #parameter_value, #post, #put, #running?, #service_uri, #status, #to_html, #to_turtle

Instance Method Details

#run(params = nil, wait = true) ⇒ String

Execute algorithm with parameters, please consult the OpenTox API and the webservice documentation for acceptable parameters

Parameters:

  • params (optional, Hash) (defaults to: nil)

    Algorithm parameters

  • wait (optional, Boolean) (defaults to: true)

    set to false if method should return a task uri instead of the algorithm result

Returns:

  • (String)

    URI of new resource (dataset, model, …)


11
12
13
14
# File 'lib/algorithm.rb', line 11

def run params=nil, wait=true
  uri = RestClientWrapper.post @uri, params, { :content_type => "text/uri-list"}
  wait_for_task uri if wait
end