From 016403f7db0dedf8237f29af41312b5ff2720c30 Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Wed, 5 Oct 2016 14:10:25 +0200 Subject: compound and descriptor tests fixed --- test/descriptor.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'test/descriptor.rb') diff --git a/test/descriptor.rb b/test/descriptor.rb index cd0c1ff..2a5be60 100644 --- a/test/descriptor.rb +++ b/test/descriptor.rb @@ -28,34 +28,34 @@ class DescriptorTest < MiniTest::Test c = OpenTox::Compound.from_smiles "CC(=O)CC(C)C#N" PhysChem.openbabel_descriptors # required for descriptor initialisation, TODO: move into libs PhysChem.find_or_create_by(:name => "Openbabel.logP") - result = c.physchem [PhysChem.find_or_create_by(:name => "Openbabel.logP")] + result = c.calculated_physchem [PhysChem.find_or_create_by(:name => "Openbabel.logP")] assert_equal 1.12518, result.first.last.round(5) end def test_compound_cdk_single PhysChem.cdk_descriptors # required for descriptor initialisation, TODO: move into libs c = OpenTox::Compound.from_smiles "c1ccccc1" - result = c.physchem [PhysChem.find_or_create_by(:name => "Cdk.AtomCount.nAtom")] + result = c.calculated_physchem [PhysChem.find_or_create_by(:name => "Cdk.AtomCount.nAtom")] assert_equal 12, result.first.last c = OpenTox::Compound.from_smiles "CC(=O)CC(C)C#N" - result = c.physchem [PhysChem.find_or_create_by(:name => "Cdk.AtomCount.nAtom")] + result = c.calculated_physchem [PhysChem.find_or_create_by(:name => "Cdk.AtomCount.nAtom")] assert_equal 17, result.first.last c_types = {"Cdk.CarbonTypes.C1SP1"=>1, "Cdk.CarbonTypes.C2SP1"=>0, "Cdk.CarbonTypes.C1SP2"=>0, "Cdk.CarbonTypes.C2SP2"=>1, "Cdk.CarbonTypes.C3SP2"=>0, "Cdk.CarbonTypes.C1SP3"=>2, "Cdk.CarbonTypes.C2SP3"=>1, "Cdk.CarbonTypes.C3SP3"=>1, "Cdk.CarbonTypes.C4SP3"=>0} physchem_features = c_types.collect{|t,nr| PhysChem.find_or_create_by(:name => t)} - result = c.physchem physchem_features + result = c.calculated_physchem physchem_features assert_equal [1, 0, 0, 1, 0, 2, 1, 1, 0], result.values end def test_compound_joelib_single PhysChem.joelib_descriptors # required for descriptor initialisation, TODO: move into libs c = OpenTox::Compound.from_smiles "CC(=O)CC(C)C#N" - result = c.physchem [PhysChem.find_or_create_by(:name => "Joelib.LogP")] + result = c.calculated_physchem [PhysChem.find_or_create_by(:name => "Joelib.LogP")] assert_equal 2.65908, result.first.last end def test_compound_all c = OpenTox::Compound.from_smiles "CC(=O)CC(C)C#N" - result = c.physchem PhysChem.descriptors + result = c.calculated_physchem PhysChem.descriptors amr = PhysChem.find_or_create_by(:name => "Cdk.ALOGP.AMR", :library => "Cdk") sbonds = PhysChem.find_by(:name => "Openbabel.sbonds") assert_equal 30.8723, result[amr.id.to_s] @@ -65,7 +65,7 @@ class DescriptorTest < MiniTest::Test 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)} + result = c.calculated_physchem [ "Openbabel.logP", "Cdk.AtomCount.nAtom", "Joelib.LogP" ].collect{|d| PhysChem.find_or_create_by(:name => d)} assert_equal 3, result.size result.each do |fid,v| feature = Feature.find(fid) -- cgit v1.2.3