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
Describe the bug
Goal is to make a new Chem.Mol of a given conformer in the application of using o3a align to get the best scoring conformer. I followed the description outlined in the rdkit blog post https://greglandrum.github.io/rdkit-blog/posts/2023-02-04-working-with-conformers.html and encountered a bug (or misunderstanding) in the visualization of the mol for the different conformers that do not have id=0.
results in ValueError: Bad Conformer Id in Chem.Draw
Expected behavior
The draw mol function does a hard assumption that it must be confId=0, but when plucking conformers out of a set, it would be nice to keep its ID so as to maintain its id origin. Could the drawing function take the first conformer to draw?
Alternative drawing tools such as py3dmol will render the conformer correctly since the confId does not seem to be referenced,
The text was updated successfully, but these errors were encountered:
Confirmed. Thanks for the bug report @kekulai-fredchang
Here's a short reproducible
from rdkit import Chem
from rdkit.Chem import Draw
from rdkit.Chem import rdDistGeom
m = Chem.AddHs(Chem.MolFromSmiles('CCCCCCC'))
rdDistGeom.EmbedMolecule(m)
m.GetConformer().SetId(5)
d2d = Draw.MolDraw2DCairo(200,200)
d2d.DrawMolecule(m)
greglandrum
changed the title
plotting mol with a non zero confID results in bad confID error
drawing mol with a non zero confID results in bad confID error
May 2, 2024
FWIW: this doesn't happen with the SVG molecule renderer. It seems to be specific to MolDraw2DCairo, which means that if you do IPythonConsole.ipython_useSVG=True things should work.
Describe the bug
Goal is to make a new Chem.Mol of a given conformer in the application of using o3a align to get the best scoring conformer. I followed the description outlined in the rdkit blog post https://greglandrum.github.io/rdkit-blog/posts/2023-02-04-working-with-conformers.html and encountered a bug (or misunderstanding) in the visualization of the mol for the different conformers that do not have id=0.
To Reproduce
notebook as done in and go to last line to render a new molecule with the conformer of interest:
https://greglandrum.github.io/rdkit-blog/posts/2023-02-04-working-with-conformers.html
cp = Chem.Mol(esomeprazole,confId=5)
cp
results in
ValueError: Bad Conformer Id in Chem.Draw
Expected behavior
The draw mol function does a hard assumption that it must be confId=0, but when plucking conformers out of a set, it would be nice to keep its ID so as to maintain its id origin. Could the drawing function take the first conformer to draw?
Alternative drawing tools such as py3dmol will render the conformer correctly since the confId does not seem to be referenced,
The text was updated successfully, but these errors were encountered: