From 3bb4f9e651d959ec53d8a84cdd0f0e52e4eade9d Mon Sep 17 00:00:00 2001 From: dv Date: Tue, 19 Jul 2011 14:23:29 +0200 Subject: saving --- lib/algorithm.rb | 4 +++- lib/compound.rb | 1 + lib/model.rb | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/algorithm.rb b/lib/algorithm.rb index 2f4bea6..53e58eb 100644 --- a/lib/algorithm.rb +++ b/lib/algorithm.rb @@ -153,6 +153,8 @@ module OpenTox # @param [Array] features_a Features of first compound # @param [Array] features_b Features of second compound # @param [optional, Hash] weights Weights for all features + # @param [optional, Hash] params Keys: `fingerprints:, compound:, nr_hits:` are required + # @return [Float] (Weighted) tanimoto similarity def self.tanimoto(features_a,features_b,weights=nil,params=nil) common_features = features_a & features_b @@ -824,7 +826,7 @@ module OpenTox def self.support(feature,params) LOGGER.debug "dv ------------- feature: #{feature}" LOGGER.debug "dv ------------- compound #{params[:compound]}" - LOGGER.debug "dv ------------- value #{params[:fingerprints][params[:compound]][feature]}" + LOGGER.debug "dv ------------- feature value #{params[:fingerprints][params[:compound]][feature]}" params[:fingerprints][params[:compound]][feature] end diff --git a/lib/compound.rb b/lib/compound.rb index 87467d9..3ec321a 100644 --- a/lib/compound.rb +++ b/lib/compound.rb @@ -178,6 +178,7 @@ module OpenTox obconversion.read_string(obmol,@inchi) smarts_pattern = OpenBabel::OBSmartsPattern.new smarts_hits = {} + LOGGER.debug "dv ----------- obmol #{Compound.new(@inchi).to_smiles}" smarts_array.collect do |smarts| LOGGER.debug "dv ----------- all smarts #{smarts}" smarts_pattern.init(smarts) diff --git a/lib/model.rb b/lib/model.rb index 52be6d4..4aefea3 100644 --- a/lib/model.rb +++ b/lib/model.rb @@ -312,7 +312,7 @@ module OpenTox def add_neighbor(training_features, training_compound) compound_match_hits = {} if @nr_hits == "true" - compound_match_hits = OpenTox::Compound.new(training_compound).match_hits(@compound_features) + compound_match_hits = @compound.match_hits(@compound_features) #OpenTox::Compound.new(training_compound).match_hits(@compound_features) LOGGER.debug "dv ------------ training_compound: #{training_compound}" LOGGER.debug "dv ------------ training_features: #{training_features}" LOGGER.debug "dv ------------ compound_features: #{@compound_features}" -- cgit v1.2.3