summaryrefslogtreecommitdiff
path: root/helper.rb
diff options
context:
space:
mode:
authormr <mr@mrautenberg.de>2011-07-12 11:43:53 +0200
committermr <mr@mrautenberg.de>2011-07-12 11:43:53 +0200
commitda05e77d831aa174adfa8d487345f2c6f3a80ec3 (patch)
treee965c5ae8964d78731df6cb476546024f7e9e3c6 /helper.rb
parent2e79dc191027651acdda0e63c32da78a9c33148b (diff)
fix broken prediction details https://github.com/opentox/toxcreate/issues/49
Diffstat (limited to 'helper.rb')
-rw-r--r--helper.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/helper.rb b/helper.rb
index 2bbab30..0acb90e 100644
--- a/helper.rb
+++ b/helper.rb
@@ -53,7 +53,13 @@ helpers do
def sort(descriptors)
features = {:activating => [], :deactivating => []}
- descriptors.each { |d| features[d[OT.effect].to_sym] << {:smarts => d[OT.smarts],:p_value => d[OT.pValue]} }
+ descriptors.each do |d|
+ if d[OT.effect] =~ TRUE_REGEXP
+ features[:activating] << {:smarts => d[OT.smarts],:p_value => d[OT.pValue]}
+ elsif d[OT.effect] =~ FALSE_REGEXP
+ features[:deactivating] << {:smarts => d[OT.smarts],:p_value => d[OT.pValue]}
+ end
+ end
features
end