Dear Jason,
The geometry that you/me visualized in a 2D plot necessarily doesn't exist
in real world except a few planner molecules. To view 3D geometry of a
molecule, 2D representation doesn't work. Please feel free to do whatever
you want to do with your molecule while producing 2D graph. Everyon
Thank you Malitha,
If I'm understanding the Draw code (not a given, my python ist nicht gut),
then MolToMPL (or MolToImage) is just using the 3D conformation generated
by EmbedMolecule. Is it just chopping off the z-coordinate? For
acetylene, this works out because it gets embedded mostly in the
Hi Jason,
I hope the following codes will help you a little.
from rdkit import Chem
from rdkit.Chem import Draw
from rdkit.Chem import AllChem
size = (120, 120)
m = Chem.MolFromSmiles('C#C')
m2=Chem.rdmolops.AddHs(m)
AllChem.EmbedMolecule(m2, AllChem.ETKDG())
Draw.MolToMPL(m2, size=size)
*** sou
m = Chem.MolFromSmiles('C#C')
renders fine
[image: Inline image 1]
but adding in the hydrogens, they don't snap to a linear arrangement
m2=Chem.rdmolops.AddHs(m)
[image: Inline image 3]
This doesn't just affect acetylene, but any terminal alkyne, like
'c1ccc(CCC#C)cc1'.
I can write a hack
4 matches
Mail list logo