From c7e1db4b44fbf1d457e00a44e0df895977adad0a Mon Sep 17 00:00:00 2001 From: Marco Biasini <marco.biasini@unibas.ch> Date: Fri, 22 Oct 2010 15:05:34 +0200 Subject: [PATCH] added unit test for deuterium import --- modules/conop/src/conop.cc | 1 + modules/io/tests/test_io_pdb.cc | 16 ++++++++++++++++ .../tests/testfiles/pdb/val-with-deuterium.pdb | 16 ++++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 modules/io/tests/testfiles/pdb/val-with-deuterium.pdb diff --git a/modules/conop/src/conop.cc b/modules/conop/src/conop.cc index e21519d7c..e992fd7d5 100644 --- a/modules/conop/src/conop.cc +++ b/modules/conop/src/conop.cc @@ -55,6 +55,7 @@ Conopology::Conopology(): known_elements_.insert("BR"); known_elements_.insert("C"); known_elements_.insert("CA"); + known_elements_.insert("D"); known_elements_.insert("CD"); known_elements_.insert("CE"); known_elements_.insert("CF"); diff --git a/modules/io/tests/test_io_pdb.cc b/modules/io/tests/test_io_pdb.cc index 1c9218aa4..fe1abe329 100644 --- a/modules/io/tests/test_io_pdb.cc +++ b/modules/io/tests/test_io_pdb.cc @@ -190,6 +190,20 @@ BOOST_AUTO_TEST_CASE(no_endmdl_record) BOOST_CHECK_THROW(reader.Import(ent), IOException); } +BOOST_AUTO_TEST_CASE(deuterium_import) +{ + String fname("testfiles/pdb/val-with-deuterium.pdb"); + PDBReader reader(fname); + mol::EntityHandle ent=mol::CreateEntity(); + reader.Import(ent); + // we use conopology to mark amino acids as peptide-linking. + conop::Conopology& conop_inst=conop::Conopology::Instance(); + conop_inst.ConnectAll(conop_inst.GetBuilder(), ent); + // this check makes sure that we correctly detect deal with the deuterium + // atoms in the residue. + BOOST_CHECK(ent.FindResidue("A", 297).IsPeptideLinking()); +} + BOOST_AUTO_TEST_CASE(faulty_lines) { String fname("testfiles/pdb/faulty.pdb"); @@ -399,4 +413,6 @@ BOOST_AUTO_TEST_CASE(atom_name_too_long) BOOST_CHECK_THROW(writer.Write(ent), IOException); } + + BOOST_AUTO_TEST_SUITE_END() diff --git a/modules/io/tests/testfiles/pdb/val-with-deuterium.pdb b/modules/io/tests/testfiles/pdb/val-with-deuterium.pdb new file mode 100644 index 000000000..6c623a1ef --- /dev/null +++ b/modules/io/tests/testfiles/pdb/val-with-deuterium.pdb @@ -0,0 +1,16 @@ +ATOM 4772 N VAL A 297 26.034 -2.215 17.509 1.00 14.11 N +ATOM 4773 CA VAL A 297 25.704 -3.589 17.846 1.00 15.41 C +ATOM 4774 C VAL A 297 24.570 -4.026 16.905 1.00 15.48 C +ATOM 4775 O VAL A 297 24.557 -5.141 16.370 1.00 16.17 O +ATOM 4776 CB VAL A 297 25.107 -3.702 19.323 1.00 20.96 C +ATOM 4777 CG1 VAL A 297 24.248 -4.971 19.490 1.00 42.92 C +ATOM 4778 CG2 VAL A 297 26.208 -3.657 20.282 1.00 32.10 C +ATOM 4779 D VAL A 297 25.787 -1.658 18.107 1.00 15.70 D +ATOM 4780 DA VAL A 297 26.490 -4.176 17.775 1.00 13.23 D +ATOM 4781 DB VAL A 297 24.531 -2.950 19.540 1.00 12.82 D +ATOM 4782 DG11 VAL A 297 23.948 -5.038 20.400 1.00 47.60 D +ATOM 4783 DG12 VAL A 297 23.489 -4.925 18.903 1.00 46.87 D +ATOM 4784 DG13 VAL A 297 24.779 -5.737 19.277 1.00 48.62 D +ATOM 4785 DG21 VAL A 297 25.850 -3.693 21.173 1.00 34.84 D +ATOM 4786 DG22 VAL A 297 26.791 -4.401 20.116 1.00 33.13 D +ATOM 4787 DG23 VAL A 297 26.704 -2.845 20.129 1.00 28.37 D \ No newline at end of file -- GitLab