Class: OpenTox::Model::PropertyLazar
Constant Summary
Constants inherited from Generic
Instance Attribute Summary collapse
-
#activities ⇒ Object
, :effects, :p_values.
-
#feature_dataset_uri ⇒ Object
, :effects, :p_values.
-
#features ⇒ Object
, :effects, :p_values.
-
#properties ⇒ Object
, :effects, :p_values.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ PropertyLazar
constructor
A new instance of PropertyLazar.
- #save ⇒ Object
Methods inherited from Generic
Constructor Details
#initialize ⇒ PropertyLazar
Returns a new instance of PropertyLazar.
116 117 118 119 120 121 122 123 124 125 |
# File 'lib/model.rb', line 116 def initialize @source = "http://github.com/helma/opentox-model" @algorithm = File.join(@@config[:services]["opentox-algorithm"],"property_lazar") #@independent_variables = File.join(@@config[:services]["opentox-algorithm"],"fminer#BBRC_representative") @features = [] #@effects = {} @activities = {} #@p_values = {} @properties = {} end |
Instance Attribute Details
#activities ⇒ Object
, :effects, :p_values
114 115 116 |
# File 'lib/model.rb', line 114 def activities @activities end |
#feature_dataset_uri ⇒ Object
, :effects, :p_values
114 115 116 |
# File 'lib/model.rb', line 114 def feature_dataset_uri @feature_dataset_uri end |
#features ⇒ Object
, :effects, :p_values
114 115 116 |
# File 'lib/model.rb', line 114 def features @features end |
#properties ⇒ Object
, :effects, :p_values
114 115 116 |
# File 'lib/model.rb', line 114 def properties @properties end |
Class Method Details
.find_all ⇒ Object
133 134 135 |
# File 'lib/model.rb', line 133 def self.find_all RestClientWrapper.get(@@config[:services]["opentox-model"]).chomp.split("\n") end |
.predict(compound_uri, model_uri) ⇒ Object
137 138 139 140 |
# File 'lib/model.rb', line 137 def self.predict(compound_uri,model_uri) #RestClientWrapper.post(model_uri,{:compound_uri => compound_uri, :accept => 'application/x-yaml'}) `curl -X POST -d 'compound_uri=#{compound_uri}' -H 'Accept:application/x-yaml' #{model_uri}` end |
Instance Method Details
#save ⇒ Object
127 128 129 130 131 |
# File 'lib/model.rb', line 127 def save @features.uniq! resource = RestClient::Resource.new(@@config[:services]["opentox-model"], :user => @@users[:users].keys[0], :password => @@users[:users].values[0]) resource.post(self.to_yaml, :content_type => "application/x-yaml").chomp.to_s end |