From 79238bddb59607aa9f759caa9e3c8db176709703 Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Thu, 28 Apr 2016 12:19:48 +0200 Subject: compound validations fixed --- lib/model.rb | 1 - lib/nanoparticle.rb | 2 +- lib/regression.rb | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/model.rb b/lib/model.rb index 80b4685..f61368e 100644 --- a/lib/model.rb +++ b/lib/model.rb @@ -50,7 +50,6 @@ module OpenTox end def predict_compound compound - #p compound neighbors = compound.send(neighbor_algorithm, neighbor_algorithm_parameters) # remove neighbors without prediction_feature # check for database activities (neighbors may include query compound) diff --git a/lib/nanoparticle.rb b/lib/nanoparticle.rb index b5de5b9..83b97a9 100644 --- a/lib/nanoparticle.rb +++ b/lib/nanoparticle.rb @@ -8,7 +8,7 @@ module OpenTox field :bundles, type: Array, default: [] def nanoparticle_neighbors params - Dataset.find(params[:training_dataset_id]).nanoparticles + Dataset.find(params[:training_dataset_id]).nanoparticles.collect{|np| {"_id" => np.id, "tanimoto" => 1}} end def add_feature feature, value diff --git a/lib/regression.rb b/lib/regression.rb index 3a59c14..694a2dc 100644 --- a/lib/regression.rb +++ b/lib/regression.rb @@ -85,7 +85,7 @@ module OpenTox activities = [] weights = [] - pc_ids = neighbors.collect{|n| n.physchem_descriptors.keys}.flatten.uniq + pc_ids = neighbors.collect{|n| Substance.find(n["_id"]).physchem_descriptors.keys}.flatten.uniq data_frame = [] data_frame[0] = [] -- cgit v1.2.3