summaryrefslogtreecommitdiff
path: root/helper.rb
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.ch>2010-11-24 13:10:52 +0100
committerChristoph Helma <helma@in-silico.ch>2010-11-24 13:10:52 +0100
commit1952b3ed877e4791429512def5bd7102e4ba7a99 (patch)
tree624d3fde40b7abd2ae902e9635b1a1dcfa5df2b0 /helper.rb
parent99e3566a11a1d51df91a6d3d016e8ec260920020 (diff)
opentox-ruby-api-wrapper renamed to opentox-ruby
Diffstat (limited to 'helper.rb')
-rw-r--r--helper.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/helper.rb b/helper.rb
index d100c9e..d691103 100644
--- a/helper.rb
+++ b/helper.rb
@@ -12,8 +12,16 @@ helpers do
haml :js_link, :locals => {:name => name, :destination => destination, :method => "toggle"}, :layout => false
end
- def compound_image(compound,features)
- haml :compound_image, :locals => {:compound => compound, :features => features}, :layout => false
+ def sort(descriptors)
+ features = {:activating => [], :deactivating => []}
+
+ descriptors.each { |d| LOGGER.debug d.inspect; features[d[OT.effect].to_sym] << {:smarts => d[OT.smarts],:p_value => d[OT.pValue]} }
+ LOGGER.debug features.to_yaml
+ features
+ end
+
+ def compound_image(compound,descriptors)
+ haml :compound_image, :locals => {:compound => compound, :features => sort(descriptors)}, :layout => false
end
def activity_markup(activity)