diff options
author | Christoph Helma <helma@in-silico.ch> | 2017-08-22 19:58:41 +0200 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2017-08-22 19:58:41 +0200 |
commit | aeee43f20f0d7ee64e93f88fdf7a8bfda28ec1ce (patch) | |
tree | 204dcb814d46d991426de9dae53b62af528d8a9d /lib | |
parent | d63b4729dc3af22c40e40b06d768ec24f8cdda4b (diff) |
tests for all rules
Diffstat (limited to 'lib')
-rw-r--r-- | lib/toxtree.rb | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/lib/toxtree.rb b/lib/toxtree.rb index 3234f6a..f395968 100644 --- a/lib/toxtree.rb +++ b/lib/toxtree.rb @@ -3,13 +3,6 @@ require 'tempfile' class Toxtree RULES = { -#toxtree.plugins.lewis.LewisTree -#toxtree.plugins.moa.MOARules -#toxtree.plugins.search.CompoundLookup -#toxtree.plugins.smartcyp.rules.SMARTCYPRuleHigherRank -#toxtree.plugins.smartcyp.rules.SMARTCYPRuleRank1 -#toxtree.plugins.smartcyp.rules.SMARTCYPRuleRank2 -#toxtree.plugins.smartcyp.rules.SMARTCYPRuleRank3 "Cramer rules" => { :java_class => "toxTree.tree.cramer.CramerRules", :url => "http://toxtree.sourceforge.net/cramer.html" @@ -80,12 +73,13 @@ class Toxtree `cd #{File.join(File.dirname(__FILE__),"..","Toxtree-v2.6.13","Toxtree")}; java -jar Toxtree-2.6.13.jar -i #{input.path} -m #{RULES[name][:java_class]} -n -o #{output}` prediction = CSV.read(output) header = prediction.shift + header.pop # remove last empty element prediction.each do |line| p = {"rule" => name} header.each_with_index do |h,i| - p[h] = line[i] unless h == "" + p[h] = line[i] end - predictions << p#{:smiles => line[0], :prediction => line[2], :rule => name} + predictions << p end end ensure |