Class: OpenTox::Lazar

Inherits:
OpenTox show all
Defined in:
lib/opentox-ruby-api-wrapper.rb

Instance Attribute Summary

Attributes inherited from OpenTox

#uri

Instance Method Summary collapse

Methods inherited from OpenTox

#destroy, #finished?, #name, #uri_escape

Constructor Details

#initialize(params) ⇒ Lazar

Create a new prediction model from a dataset



155
156
157
158
159
160
161
# File 'lib/opentox-ruby-api-wrapper.rb', line 155

def initialize(params)
	if params[:uri]
		@uri = params[:uri]
	elsif params[:dataset_uri]
		@uri = RestClient.post ENV['OPENTOX_LAZAR'] + 'models' , :dataset_uri => params[:dataset_uri]
	end
end

Instance Method Details

#predict(compound) ⇒ Object

Predict a compound



164
165
166
# File 'lib/opentox-ruby-api-wrapper.rb', line 164

def predict(compound)
	LazarPrediction.new(:uri => RestClient.post(@uri, :compound_uri => compound.uri))
end