Class: OpenTox::Model::Lazar
Constant Summary
Constants inherited from Generic
Instance Attribute Summary collapse
-
#activities ⇒ Object
Returns the value of attribute activities.
-
#effects ⇒ Object
Returns the value of attribute effects.
-
#feature_dataset_uri ⇒ Object
Returns the value of attribute feature_dataset_uri.
-
#features ⇒ Object
Returns the value of attribute features.
-
#fingerprints ⇒ Object
Returns the value of attribute fingerprints.
-
#p_values ⇒ Object
Returns the value of attribute p_values.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Lazar
constructor
A new instance of Lazar.
- #save ⇒ Object
Methods inherited from Generic
Constructor Details
#initialize ⇒ Lazar
Returns a new instance of Lazar.
85 86 87 88 89 90 91 92 93 94 |
# File 'lib/model.rb', line 85 def initialize @source = "http://github.com/helma/opentox-model" @algorithm = File.join(@@config[:services]["opentox-algorithm"],"lazar") #@independent_variables = File.join(@@config[:services]["opentox-algorithm"],"fminer#BBRC_representative") @features = [] @effects = {} @activities = {} @p_values = {} @fingerprints = {} end |
Instance Attribute Details
#activities ⇒ Object
Returns the value of attribute activities.
83 84 85 |
# File 'lib/model.rb', line 83 def activities @activities end |
#effects ⇒ Object
Returns the value of attribute effects.
83 84 85 |
# File 'lib/model.rb', line 83 def effects @effects end |
#feature_dataset_uri ⇒ Object
Returns the value of attribute feature_dataset_uri.
83 84 85 |
# File 'lib/model.rb', line 83 def feature_dataset_uri @feature_dataset_uri end |
#features ⇒ Object
Returns the value of attribute features.
83 84 85 |
# File 'lib/model.rb', line 83 def features @features end |
#fingerprints ⇒ Object
Returns the value of attribute fingerprints.
83 84 85 |
# File 'lib/model.rb', line 83 def fingerprints @fingerprints end |
#p_values ⇒ Object
Returns the value of attribute p_values.
83 84 85 |
# File 'lib/model.rb', line 83 def p_values @p_values end |
Class Method Details
.find_all ⇒ Object
102 103 104 |
# File 'lib/model.rb', line 102 def self.find_all RestClientWrapper.get(@@config[:services]["opentox-model"]).chomp.split("\n") end |
.predict(compound_uri, model_uri) ⇒ Object
106 107 108 109 |
# File 'lib/model.rb', line 106 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
96 97 98 99 100 |
# File 'lib/model.rb', line 96 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 |