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
I'm trying to visualise fingerprints with DrawMorganBit but an error occurs when prepareMolsBeforeDrawing=True (the default) and stereochemistry is not displayed when prepareMolsBeforeDrawing=False. To reproduce:
Generate the fingerprints for a molecule and plot the molecule
[23:39:09]
****
Invariant Violation
no eligible neighbors for chiral center
Violation occurred on line 240 in file /Users/runner/work/rdkit-pypi/rdkit-pypi/build/temp.macosx-11.0-arm64-cpython-39/rdkit/Code/GraphMol/FileParsers/MolFileStereochem.cpp
Failed Expression: nbrScores.size()
****
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
Cell In[16], line 1
----> 1 Draw.DrawMorganBit(mol, fingerprint, info)
File ~/Library/Caches/pypoetry/virtualenvs/drugpredictor-wS4XGoJo-py3.9/lib/python3.9/site-packages/rdkit/Chem/Draw/IPythonConsole.py:304, in DrawMorganBit(mol, bitId, bitInfo, drawOptions, **kwargs)
302 else:
303 fn = Draw.DrawMorganBit
--> 304 return _DrawBit(fn, mol, bitId, bitInfo, drawOptions=drawOptions, **kwargs)
File ~/Library/Caches/pypoetry/virtualenvs/drugpredictor-wS4XGoJo-py3.9/lib/python3.9/site-packages/rdkit/Chem/Draw/IPythonConsole.py:277, in _DrawBit(fn, *args, **kwargs)
274 if 'useSVG' not in kwargs:
275 kwargs['useSVG'] = ipython_useSVG
--> 277 res = fn(*args, **kwargs)
278 if kwargs['useSVG']:
279 return SVG(res)
File ~/Library/Caches/pypoetry/virtualenvs/drugpredictor-wS4XGoJo-py3.9/lib/python3.9/site-packages/rdkit/Chem/Draw/__init__.py:701, in DrawMorganBit(mol, bitId, bitInfo, whichExample, **kwargs)
699 def DrawMorganBit(mol, bitId, bitInfo, whichExample=0, **kwargs):
700 atomId, radius = bitInfo[bitId][whichExample]
--> 701 return DrawMorganEnv(mol, atomId, radius, **kwargs)
File ~/Library/Caches/pypoetry/virtualenvs/drugpredictor-wS4XGoJo-py3.9/lib/python3.9/site-packages/rdkit/Chem/Draw/__init__.py:865, in DrawMorganEnv(mol, atomId, radius, molSize, baseRad, useSVG, aromaticColor, ringColor, centerColor, extraColor, drawOptions, **kwargs)
863 drawOptions.includeMetadata = False
864 drawer.SetDrawOptions(drawOptions)
--> 865 drawer.DrawMolecule(menv.submol, highlightAtoms=menv.highlightAtoms,
866 highlightAtomColors=menv.atomColors, highlightBonds=menv.highlightBonds,
867 highlightBondColors=menv.bondColors, highlightAtomRadii=menv.highlightRadii,
868 **kwargs)
869 drawer.FinishDrawing()
870 return drawer.GetDrawingText()
RuntimeError: Invariant Violation
no eligible neighbors for chiral center
Violation occurred on line 240 in file Code/GraphMol/FileParsers/MolFileStereochem.cpp
Failed Expression: nbrScores.size()
RDKIT: 2022.03.5
BOOST: 1_75
Expected behavior
The fingerprint should be plotted correctly by default, and preserve the stereochemistry of the parent molecule. From my understanding, DrawMorganBit should plot a zoom of the molecule on the fingerprint environment. But it seems some additional steps happen here that attempt to sanitize or modify the fingerprint environment before plotting
Configuration (please complete the following information):
RDKit version: 2022.03.5
OS: macOS
Python version (if relevant): 3.9
Are you using conda? No
If you are using conda, which channel did you install the rdkit from? pipit
If you are not using conda: how did you install the RDKit? pip install rdkit-pypi
The text was updated successfully, but these errors were encountered:
I'm trying to visualise fingerprints with
DrawMorganBit
but an error occurs whenprepareMolsBeforeDrawing=True
(the default) and stereochemistry is not displayed whenprepareMolsBeforeDrawing=False
. To reproduce:prepareMolsBeforeDrawing=False
-> OK but does not display stereochemistryExpected behavior
The fingerprint should be plotted correctly by default, and preserve the stereochemistry of the parent molecule. From my understanding,
DrawMorganBit
should plot a zoom of the molecule on the fingerprint environment. But it seems some additional steps happen here that attempt to sanitize or modify the fingerprint environment before plottingConfiguration (please complete the following information):
The text was updated successfully, but these errors were encountered: