Dear all,
please consider the following code:
IAtomContainer mol = new SmilesParser(SilentChemObjectBuilder.getInstance()).parseSmiles("C[C@@H](O)CC[C@H](C)/C=C(/C)C(=O)O");
SmilesGenerator smiGen = new SmilesGenerator(SmiFlavor.Stereo);
System.out.println(smiGen.create(mol));
mol.removeAtom(0);
System.out.println(smiGen.create(mol));
Input structure:
The Output:
C[C@@H](O)CC[C@H](C)/C=C(/C)\C(=O)O
[CH](O)CC[C@H](C)C=C(C)C(=O)O
Before removal:
After removal of one atom (sorry for the orientation flip):
This shows that even tough an atom that has nothing to do with the double bond stereochemistry "further down the line" is removed here, said stereo configuration is lost.
I think the problem is in this method:
|
private void updateStereochemistry(IBond removedBond) { |
At the end, a double bond stereochemistry object is marked as invalidated when it has no overlap with the removed bond/atom.
What do you think about this?
I tried fixing it by simply removing these lines:
} else {
invalidated.add(se);
}
... but that caused a test to fail (SmilesGeneratorTest.deletingBondUpdatesCisTrans2().
Dear all,
please consider the following code:
Input structure:
The Output:
Before removal:
After removal of one atom (sorry for the orientation flip):
This shows that even tough an atom that has nothing to do with the double bond stereochemistry "further down the line" is removed here, said stereo configuration is lost.
I think the problem is in this method:
cdk/base/data/src/main/java/org/openscience/cdk/AtomContainer.java
Line 1125 in a718006
At the end, a double bond stereochemistry object is marked as invalidated when it has no overlap with the removed bond/atom.
What do you think about this?
I tried fixing it by simply removing these lines:
... but that caused a test to fail (SmilesGeneratorTest.deletingBondUpdatesCisTrans2().