You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by laurenreid1 November 19, 2021
Hi everyone,
I'd like to depict a benzocyclohexane-like compound containing 2 dummy atoms within the cyclohexane ring (e.g c12ccccc1*-*CC2). Using the following code:
from rdkit import Chem
from rdkit.Chem import Draw
from rdkit.Chem.Draw import rdMolDraw2D
mol = Chem.MolFromSmiles("c12ccccc1*-*CC2")
dm = Draw.PrepareMolForDrawing(mol)
d2d = rdMolDraw2D.MolDraw2DCairo(240, 135)
d2d.DrawMolecule(dm)
d2d.FinishDrawing()
draw_text = d2d.GetDrawingText()
with open("test.png", "wb") as f:
f.write(draw_text)
I receive this depicition that adds a double bond between the 2 dummies:
I believe this is happening during kekulization, where the conjugation of the dummy atoms to the benzene ring is interpreted as aromaticity? I can turn off the behaviour using the following:
from rdkit import Chem
from rdkit.Chem import Draw
from rdkit.Chem.Draw import rdMolDraw2D
mol = Chem.MolFromSmiles("c12ccccc1*-*CC2", sanitize=False)
mol.UpdatePropertyCache()
dm = Draw.PrepareMolForDrawing(mol, kekulize=False)
d2d = rdMolDraw2D.MolDraw2DCairo(240, 135)
d2d.drawOptions().prepareMolsBeforeDrawing = False
d2d.DrawMolecule(dm)
d2d.FinishDrawing()
draw_text = d2d.GetDrawingText()
with open("test.png", "wb") as f:
f.write(draw_text)
But this leaves me with the following depiction:
Does anyone know if there's a way I can depict the benzene ring in its kekulized form while keeping the bond between the dummy atoms as a single aliphatic bond? I've been playing around with the santizeflags but haven't found a combination that will allow only the benzene bonds to be kekulized.
Thanks,
Lauren
EDIT: My RDKit version is 2020.03.3
The text was updated successfully, but these errors were encountered:
ptosco
pushed a commit
to ptosco/rdkit
that referenced
this issue
Nov 21, 2021
* fixes#4721
* - store in RingInfo the index of the ring(s) each atom and bond belongs to rather tham just their size
- expand the RingInfo API with a few useful methods
- identify rings that are certainly aliphatic upfront
- avoid unnecessary copying atomRings when RingInfo is already initialized
* - code modernization and cleanup
- better handling of dummies in aromatic rings
- exposed atomMembers() and bondMembers()
- added several tests
* - avoid order dependency on rings
- added test for the above
* changes in response to review
Co-authored-by: Tosco, Paolo <paolo.tosco@novartis.com>
Discussed in #4716
Originally posted by laurenreid1 November 19, 2021
Hi everyone,
I'd like to depict a benzocyclohexane-like compound containing 2 dummy atoms within the cyclohexane ring (e.g c12ccccc1*-*CC2). Using the following code:
I receive this depicition that adds a double bond between the 2 dummies:
I believe this is happening during kekulization, where the conjugation of the dummy atoms to the benzene ring is interpreted as aromaticity? I can turn off the behaviour using the following:
But this leaves me with the following depiction:
Does anyone know if there's a way I can depict the benzene ring in its kekulized form while keeping the bond between the dummy atoms as a single aliphatic bond? I've been playing around with the santizeflags but haven't found a combination that will allow only the benzene bonds to be kekulized.
Thanks,
Lauren
EDIT: My RDKit version is 2020.03.3
The text was updated successfully, but these errors were encountered: