summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordv <dv@dv.de>2011-07-19 14:23:29 +0200
committerdv <dv@dv.de>2011-07-19 14:23:29 +0200
commit3bb4f9e651d959ec53d8a84cdd0f0e52e4eade9d (patch)
tree18e6244b08f653c2ff4f97cf461234c414a27cb6
parentd21dab9f1d1f01096830ff5b8d8254c2c7ca71cf (diff)
saving
-rw-r--r--lib/algorithm.rb4
-rw-r--r--lib/compound.rb1
-rw-r--r--lib/model.rb2
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}"