This commit is contained in:
Greg Landrum
2017-01-09 22:29:06 +01:00
parent 0c8f66abb7
commit 406c222b13
3 changed files with 113 additions and 5 deletions

View File

@@ -1,6 +1,5 @@
// $Id$
//
// Copyright (C) 2004-2014 Greg Landrum and Rational Discovery LLC
// Copyright (C) 2004-2017 Greg Landrum and Rational Discovery LLC
//
// @@ All Rights Reserved @@
// This file is part of the RDKit.
@@ -656,7 +655,7 @@ void DetectAtomStereoChemistry(RWMol &mol, const Conformer *conf) {
if (dir == Bond::BEGINWEDGE || dir == Bond::BEGINDASH) {
Atom *atom = bond->getBeginAtom();
if (atom->getImplicitValence() == -1) {
atom->calcExplicitValence();
atom->calcExplicitValence(false);
atom->calcImplicitValence(false);
}
Atom::ChiralType code = FindAtomStereochemistry(mol, bond, conf);

View File

@@ -4765,6 +4765,24 @@ void testGithub1049() {
BOOST_LOG(rdInfoLog) << "done" << std::endl;
}
void testGithub1251() {
BOOST_LOG(rdInfoLog)
<< "Test github 1251: MolFromMolBlock sanitizing when it should not be"
<< std::endl;
std::string rdbase = getenv("RDBASE");
rdbase += "/Code/GraphMol/FileParsers/test_data/";
{
std::string fName = rdbase + "github1251.mol";
RWMol *m = MolFileToMol(fName, false);
TEST_ASSERT(m);
TEST_ASSERT(m->getNumAtoms() == 39);
TEST_ASSERT(m->getNumBonds() == 44);
delete m;
}
BOOST_LOG(rdInfoLog) << "done" << std::endl;
}
void RunTests() {
#if 1
test1();
@@ -4848,11 +4866,12 @@ void RunTests() {
testGithub1023();
testGithub1034();
testGithub1049();
#endif
testPDBFile();
testSequences();
// testSequenceReaders();
// testSequenceReaders();
#endif
testGithub1251();
}
// must be in German Locale for test...

View File

@@ -0,0 +1,90 @@
58
-OEChem-07261613412D
39 44 0 1 0 0 0 0 0999 V2000
2.7797 3.3689 0.0000 Tc 2 3 3 0 0 0 0 0 0 0 0 0
3.0867 2.2535 0.0000 S 0 0 0 0 0 0 0 0 0 0 0 0
1.1617 2.3585 0.0000 S 0 0 0 0 0 0 0 0 0 0 0 0
2.1936 4.6289 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
1.0917 6.3485 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
10.9562 2.0346 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
12.3693 4.3178 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
16.3490 0.7000 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
3.1917 4.4235 0.0000 N 0 0 3 0 0 0 0 0 0 0 0 0
1.1967 4.5285 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
7.1879 4.3897 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
13.7824 1.9757 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
1.6517 5.4735 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
3.0517 5.3685 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
4.3701 3.9098 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
4.4414 5.1451 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.0000 4.1389 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
4.2238 2.5175 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.0000 2.7389 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
5.2567 4.5635 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
6.0617 5.0885 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
6.7757 2.9178 0.0000 C 0 0 3 0 0 0 0 0 0 0 0 0
7.0767 0.9585 0.0000 C 0 0 3 0 0 0 0 0 0 0 0 0
9.5431 2.8000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
8.0711 2.4467 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
8.7776 1.1514 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
5.5393 2.0934 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
6.3047 1.2691 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
5.3626 0.7392 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
12.3693 2.9178 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
15.1366 2.8000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
16.3490 2.1000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
15.1366 4.2000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
16.3490 4.9000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
17.5615 2.8000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
17.5615 4.2000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
16.3490 6.3000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
17.5615 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
9.5431 4.2131 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0
1 2 1 0 0 0 0
1 3 1 0 0 0 0
1 4 2 0 0 0 0
1 9 1 0 0 0 0
1 10 1 0 0 0 0
2 18 1 0 0 0 0
3 19 1 0 0 0 0
5 13 2 0 0 0 0
6 24 1 0 0 0 0
6 30 1 0 0 0 0
7 30 2 0 0 0 0
8 32 1 0 0 0 0
8 38 1 0 0 0 0
9 14 1 0 0 0 0
9 15 1 0 0 0 0
9 16 1 1 0 0 0
10 13 1 0 0 0 0
10 17 1 0 0 0 0
11 21 1 0 0 0 0
11 22 1 0 0 0 0
11 23 1 0 0 0 0
12 30 1 0 0 0 0
12 31 1 0 0 0 0
13 14 1 0 0 0 0
15 18 1 0 0 0 0
16 20 1 0 0 0 0
17 19 1 0 0 0 0
20 21 1 0 0 0 0
22 25 1 0 0 0 0
22 27 1 0 0 0 0
23 26 1 0 0 0 0
23 28 1 0 0 0 0
24 25 1 0 0 0 0
24 26 1 0 0 0 0
24 39 1 0 0 0 0
27 29 1 0 0 0 0
28 29 1 0 0 0 0
31 32 2 0 0 0 0
31 33 1 0 0 0 0
32 35 1 0 0 0 0
33 34 2 0 0 0 0
34 36 1 0 0 0 0
34 37 1 0 0 0 0
35 36 2 0 0 0 0
M CHG 1 1 1
M ISO 1 1 99
M END