diff options
author | Christoph Helma <helma@in-silico.ch> | 2016-02-28 16:00:15 +0100 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2016-02-28 16:00:15 +0100 |
commit | d0c6234fed7d45227fcf9309cb6dc0854d17e647 (patch) | |
tree | 43f2327abbdbcb1688c2605308966e62f88c907e /lib/physchem.rb | |
parent | 8c973e16028cb95c978bb08cf79369a5c3520c31 (diff) |
physchem calculation and storage in compouds
Diffstat (limited to 'lib/physchem.rb')
-rw-r--r-- | lib/physchem.rb | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/lib/physchem.rb b/lib/physchem.rb index 1126e69..64018ad 100644 --- a/lib/physchem.rb +++ b/lib/physchem.rb @@ -37,10 +37,12 @@ module OpenTox DESCRIPTORS = OBDESCRIPTORS.merge(CDKDESCRIPTORS.merge(JOELIBDESCRIPTORS)) + require_relative "unique_descriptors.rb" - def self.descriptors - DESCRIPTORS.collect do |name,description| + def self.descriptors desc=DESCRIPTORS + # TODO create PhysChem features @startup + desc.collect do |name,description| lib,desc = name.split('.',2) self.find_or_create_by(:name => name, :library => lib, :descriptor => desc, :description => description, :measured => false, :calculated => true, :numeric => true, :nominal => false) end @@ -64,25 +66,20 @@ module OpenTox udesc end - # Description of available descriptors - def self.description descriptor - lib = descriptor.split('_').first - case lib - when "Openbabel" - OBDESCRIPTORS[descriptor] - when "Cdk" - name = descriptor.split('_')[0..-2].join('_') - CDKDESCRIPTORS[name] - when "Joelib" - JOELIBDESCRIPTORS[descriptor] - when "lookup" - "Read feature values from a dataset" - end + def self.openbabel_descriptors + descriptors OBDESCRIPTORS + end + + def self.cdk_descriptors + descriptors CDKDESCRIPTORS + end + + def self.joelib_descriptors + descriptors JOELIBDESCRIPTORS end def calculate compound result = send library.downcase,descriptor,compound - p result result[self.name] end |