summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormr <mr@mrautenberg.de>2011-07-12 11:45:36 +0200
committermr <mr@mrautenberg.de>2011-07-12 11:45:36 +0200
commit425cbf28a4686e59e9e46b9987f1e3d8348f39a1 (patch)
tree374c6ea622dc419a2cc3d5d0f6a846f4de0f0ac0
parent8f750e73832be3cccba8e53548e5ce7ffde2014b (diff)
fix broken prediction details https://github.com/opentox/toxcreate/issues/49
-rw-r--r--helper.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/helper.rb b/helper.rb
index 2bbab30..b3be149 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