Class: OpenTox::LazarPrediction
Overview
Class with special methods for lazar prediction datasets
Instance Attribute Summary
Attributes inherited from Dataset
#compounds, #data_entries, #features, #metadata
Attributes included from OpenTox
Class Method Summary collapse
-
.find(uri, subjectid = nil) ⇒ OpenTox::Dataset
Find a prediction dataset and load all data.
Instance Method Summary collapse
- #confidence(compound) ⇒ Object
- #descriptors(compound) ⇒ Object
- #measured_activities(compound) ⇒ Object
- #neighbors(compound) ⇒ Object
- #value(compound) ⇒ Object
Methods inherited from Dataset
#accept_values, #add, #add_compound, #add_feature, #add_feature_metadata, #add_metadata, all, create, create_from_csv_file, #delete, exist?, #feature_name, #feature_type, #initialize, #load_all, #load_compounds, #load_csv, #load_features, #load_metadata, #load_rdfxml, #load_rdfxml_file, #load_sdf, #load_spreadsheet, #load_yaml, #save, #split, #title, #to_csv, #to_ntriples, #to_rdfxml, #to_sdf, #to_spreadsheet, #to_urilist, #to_xls
Methods included from OpenTox
#add_metadata, all, #delete, #initialize, #load_metadata, sign_in, text_to_html, #to_rdfxml
Constructor Details
This class inherits a constructor from OpenTox::Dataset
Class Method Details
.find(uri, subjectid = nil) ⇒ OpenTox::Dataset
Find a prediction dataset and load all data.
403 404 405 406 407 |
# File 'lib/dataset.rb', line 403 def self.find(uri, subjectid=nil) prediction = LazarPrediction.new(uri, subjectid) prediction.load_all(subjectid) prediction end |
Instance Method Details
#confidence(compound) ⇒ Object
416 417 418 |
# File 'lib/dataset.rb', line 416 def confidence(compound) @data_entries[compound.uri].collect{|f,v| v.first if f.match(/confidence/)}.compact.first if @data_entries[compound.uri] end |
#descriptors(compound) ⇒ Object
420 421 422 |
# File 'lib/dataset.rb', line 420 def descriptors(compound) @data_entries[compound.uri].collect{|f,v| @features[f] if f.match(/descriptor/)}.compact if @data_entries[compound.uri] end |
#measured_activities(compound) ⇒ Object
424 425 426 |
# File 'lib/dataset.rb', line 424 def measured_activities(compound) @data_entries[compound.uri].collect{|f,v| v if f.match(/#{@metadata[OT.hasSource]}/)}.compact.flatten if @data_entries[compound.uri] end |
#neighbors(compound) ⇒ Object
428 429 430 |
# File 'lib/dataset.rb', line 428 def neighbors(compound) @data_entries[compound.uri].collect{|f,v| @features[f] if f.match(/neighbor/)}.compact if @data_entries[compound.uri] end |
#value(compound) ⇒ Object
409 410 411 412 413 414 |
# File 'lib/dataset.rb', line 409 def value(compound) v = nil v = @data_entries[compound.uri].collect{|f,v| v.first if f.match(/value/)}.compact.first if @data_entries[compound.uri] v = nil if v.is_a? Array and v.empty? v end |