summaryrefslogtreecommitdiff
path: root/compound.rb
diff options
context:
space:
mode:
authordv <dv@dv.de>2011-07-20 17:22:44 +0200
committerdv <dv@dv.de>2011-07-20 17:22:44 +0200
commit10b3774101226beb1f03dd1deb76b8f2c539b9a1 (patch)
tree30f71dbef497ce7eb26f7eb8be20b6dd3f9dcc9c /compound.rb
parenta5eb915f4c5d019ac94b7c96b51ed35d982d51b6 (diff)
Added test_match_hits to compound and modified test_p_sum_support
/test_tanimoto in algorithm
Diffstat (limited to 'compound.rb')
-rw-r--r--compound.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/compound.rb b/compound.rb
index 048e012..5165f31 100644
--- a/compound.rb
+++ b/compound.rb
@@ -39,4 +39,8 @@ class CompoundTest < Test::Unit::TestCase
assert_equal "CCC=C(CC)N(=O)=O", c.to_smiles
end
+ def test_match_hits
+ c = OpenTox::Compound.from_smiles "N=C=C1CCC(=F=FO)C1"
+ assert_equal ({"FF"=>2, "CC"=>10, "C"=>6, "C1CCCC1"=>10, "C=C"=>2}), c.match_hits(['CC','F=F','C','C=C','FF','C1CCCC1','OO'])
+ end
end