coordgenlibs
coordgenlibs copied to clipboard
Bad coordinates for some very ring-y structures
This issue: https://github.com/rdkit/rdkit/issues/3491 reports that coordgen gives pretty bad coordinates (lots of clashes or very long bonds) for a couple of molecules.
from rdkit import Chem
from rdkit.Chem import rdDepictor
from rdkit.Chem.Draw import IPythonConsole
# following SMILES seems good without SetPreferCoordGen option.
smi = 'C12CC3CC(CC3C1)C2'
ring = Chem.MolFromSmiles(smi)
rdDepictor.SetPreferCoordGen(False)
ring
ring = Chem.MolFromSmiles(smi)
rdDepictor.SetPreferCoordGen(False)
ring
looks like:

Another example:
from rdkit.Chem import rdDepictor
from rdkit.Chem import rdCoordGen
def get_image(smiles):
mol = Chem.MolFromSmiles(smiles, sanitize=True)
rdDepictor.SetPreferCoordGen(True)
rdCoordGen.AddCoords(mol)
rdDepictor.Compute2DCoords(mol)
return mol
molec = 'C1=CC=C(N(C2=CC=CC=C2)C2=CC3=C4B(C5=CC=CC=C5N3C3=CC=CC=C3)C3=C(C=C5C(=C3)B3C6=C(C=CC=C6)N(C6=CC=CC=C6)C6=CC(N(C7=CC=CC=C7)C7=CC=CC=C7)=CC(=C36)N5C3=CC=CC=C3)N(C3=CC=CC=C3)C4=C2)C=C1'
m = get_image(molec)
m

This is tracked in schrodinger's internal bug tracker as https://jira.schrodinger.com/browse/CRDGEN-271
As far as I can tell from the rdkit side, this issue is still live. I don't suppose there's been progress internally on this?