diff options
author | Christoph Helma <helma@in-silico.ch> | 2016-05-08 12:22:58 +0200 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2016-05-08 12:22:58 +0200 |
commit | 06fc914653face2c58fd4e6c47161cb03e217582 (patch) | |
tree | f001a28b3970f67bf648f6d00e95791a063e7fd5 /lib/compound.rb | |
parent | 110b470a69f785f195cce21df7c07efa5c9ce61b (diff) |
default validations fixed
Diffstat (limited to 'lib/compound.rb')
-rw-r--r-- | lib/compound.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/compound.rb b/lib/compound.rb index c2ce5d0..3af6f6c 100644 --- a/lib/compound.rb +++ b/lib/compound.rb @@ -288,7 +288,7 @@ module OpenTox training_dataset.compounds.each do |compound| candidate_fingerprint = compound.fingerprint params[:type] sim = (query_fingerprint & candidate_fingerprint).size/(query_fingerprint | candidate_fingerprint).size.to_f - neighbors << {"_id" => compound.id, "toxicities" => {prediction_feature.id.to_s => compound.toxicities[prediction_feature.id.to_s]}, "tanimoto" => sim} if sim >= params[:min_sim] + neighbors << {"_id" => compound.id, "toxicities" => {prediction_feature.id.to_s => {training_dataset_id.to_s => compound.toxicities[prediction_feature.id.to_s][training_dataset_id.to_s]}}, "tanimoto" => sim} if sim >= params[:min_sim] end neighbors.sort!{|a,b| b["tanimoto"] <=> a["tanimoto"]} end |