From c1be8fe66f640d44dbbc9bfe5212733994bfb9c5 Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Mon, 9 May 2016 15:44:29 +0200 Subject: physchem crossvalidation fixed, test_compound_descriptor_parameters assertions fixed --- test/descriptor.rb | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'test/descriptor.rb') diff --git a/test/descriptor.rb b/test/descriptor.rb index 7c2cf8b..cd0c1ff 100644 --- a/test/descriptor.rb +++ b/test/descriptor.rb @@ -63,10 +63,21 @@ class DescriptorTest < MiniTest::Test end def test_compound_descriptor_parameters + PhysChem.descriptors c = OpenTox::Compound.from_smiles "CC(=O)CC(C)C#N" result = c.physchem [ "Openbabel.logP", "Cdk.AtomCount.nAtom", "Joelib.LogP" ].collect{|d| PhysChem.find_or_create_by(:name => d)} assert_equal 3, result.size - assert_equal [1.12518, 17.0, 2.65908], result.values.collect{|v| v.round 5} + result.each do |fid,v| + feature = Feature.find(fid) + case feature.name + when "Openbabel.logP" + assert_equal 1.12518, v.round(5) + when "Cdk.AtomCount.nAtom" + assert_equal 17.0, v.round(5) + when "Joelib.LogP" + assert_equal 2.65908, v.round(5) + end + end end end -- cgit v1.2.3