diff options
author | davor <vorgrimmlerdavid@gmx.de> | 2012-05-15 18:05:15 +0200 |
---|---|---|
committer | davor <vorgrimmlerdavid@gmx.de> | 2012-05-15 18:05:15 +0200 |
commit | 370839e80d39b303be5628b779427c70e0e2d061 (patch) | |
tree | 0400c5d152b97f696e17aefddc5689b4061378da | |
parent | 9cc85cd21d4c400b2a5c20068efaac5cde56a476 (diff) |
Now supports pc descriptors.
-rw-r--r-- | lib/dataset.rb | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/dataset.rb b/lib/dataset.rb index c916722..fbc10c6 100644 --- a/lib/dataset.rb +++ b/lib/dataset.rb @@ -527,7 +527,25 @@ module OpenTox end def descriptors(compound) - @data_entries[compound.uri].collect{|f,v| @features[f] if f.match(/descriptor/)}.compact if @data_entries[compound.uri] + if @data_entries[compound.uri] + pc_features = {} + features = [] + @data_entries[compound.uri].collect{|f,v| + if f.match(/descriptor/) + features << @features[f] if f.match(/descriptor/) + else + unless @features[f][RDF::type].nil? + pc_features[f] = v if @features[f][RDF::type].join.include? "Numeric" + end + end + } + + if pc_features.empty? + features.compact + else + pc_features + end + end end def measured_activities(compound) |