fix a pathological symmetry case by modifying the atom invariants

This commit is contained in:
Greg Landrum
2014-08-24 10:51:35 +02:00
parent 5d6b636b07
commit 329bf48b77
3 changed files with 8 additions and 3 deletions

View File

@@ -93,6 +93,6 @@ rdkit_test(graphmoltestPickler testPickler.cpp
rdkit_test(graphmolIterTest itertest.cpp LINK_LIBRARIES SmilesParse GraphMol RDGeometryLib RDGeneral)
rdkit_test(hanoiTest hanoitest.cpp LINK_LIBRARIES SmilesParse_static FileParsers_static GraphMol_static
RDGeometryLib_static RDGeneral_static )
RDGeometryLib_static RDGeneral_static ${RDKit_THREAD_LIBS} )

View File

@@ -812,6 +812,7 @@ void test7(){
"C[C@H]1C[C@H](C1)N1CCN(C)CC1",
"CN1CCN(CC1)[C@H]1C[C@H](C1)c1ncc2c(N)nccn12",
"CN1CCN(CC1)[C@H]1C[C@H](C1)c1nc(-c2ccc3ccc(nc3c2)-c2ccccc2)c2c(N)nccn12",
"*12*3*1*3*4*5*4*52",
"EOS"
};
unsigned int i=0;

View File

@@ -291,8 +291,12 @@ namespace RDKit {
return 1;
// ring membership
ivi=dp_mol->getRingInfo()->numAtomRings(dp_atoms[i].atom->getIdx())!=0;
ivj=dp_mol->getRingInfo()->numAtomRings(dp_atoms[j].atom->getIdx())!=0;
// initial passes at this were just checking "isInRing" to allow
// a possible future more efficient check. These break on this
// lovely double-diamond pathological case:
// *12*3*1*3*4*5*4*52
ivi=dp_mol->getRingInfo()->numAtomRings(dp_atoms[i].atom->getIdx());
ivj=dp_mol->getRingInfo()->numAtomRings(dp_atoms[j].atom->getIdx());
if(ivi<ivj)
return -1;
else if(ivi>ivj)