diff options
author | Christoph Helma <helma@in-silico.ch> | 2016-04-28 12:19:48 +0200 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2016-04-28 12:19:48 +0200 |
commit | 79238bddb59607aa9f759caa9e3c8db176709703 (patch) | |
tree | e9c28634812a868215f742f333055d5f3030e0ac /lib | |
parent | acf19c81e345ceccde834653a0f0edce27827958 (diff) |
compound validations fixed
Diffstat (limited to 'lib')
-rw-r--r-- | lib/model.rb | 1 | ||||
-rw-r--r-- | lib/nanoparticle.rb | 2 | ||||
-rw-r--r-- | lib/regression.rb | 2 |
3 files changed, 2 insertions, 3 deletions
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] = [] |