From 425cbf28a4686e59e9e46b9987f1e3d8348f39a1 Mon Sep 17 00:00:00 2001 From: mr Date: Tue, 12 Jul 2011 11:45:36 +0200 Subject: fix broken prediction details https://github.com/opentox/toxcreate/issues/49 --- helper.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3