From 51f57e2858b60bed74ebcc97189b2188c900c283 Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Fri, 6 May 2016 12:49:28 +0200 Subject: dataset tests cleanup --- lib/compound.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/compound.rb') diff --git a/lib/compound.rb b/lib/compound.rb index 143c4f2..6cb7f78 100644 --- a/lib/compound.rb +++ b/lib/compound.rb @@ -22,6 +22,7 @@ module OpenTox # Overwrites standard Mongoid method to create fingerprints before database insertion def self.find_or_create_by params + #PhysChem.descriptors # load descriptor features compound = self.find_or_initialize_by params compound.default_fingerprint_size = compound.fingerprint(DEFAULT_FINGERPRINT).size compound.save @@ -77,7 +78,7 @@ module OpenTox def physchem descriptors=PhysChem.openbabel_descriptors # TODO: speedup java descriptors - calculated_ids = physchem.keys + calculated_ids = physchem_descriptors.keys # BSON::ObjectId instances are not allowed as keys in a BSON document. new_ids = descriptors.collect{|d| d.id.to_s} - calculated_ids descs = {} @@ -90,11 +91,11 @@ module OpenTox # avoid recalculating Cdk features with multiple values descs.keys.uniq.each do |k| descs[k].send(k[0].downcase,k[1],self).each do |n,v| - physchem[algos[n].id.to_s] = v # BSON::ObjectId instances are not allowed as keys in a BSON document. + physchem_descriptors[algos[n].id.to_s] = v # BSON::ObjectId instances are not allowed as keys in a BSON document. end end save - physchem.select{|id,v| descriptors.collect{|d| d.id.to_s}.include? id} + physchem_descriptors.select{|id,v| descriptors.collect{|d| d.id.to_s}.include? id} end def smarts_match smarts, count=false -- cgit v1.2.3