Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plot_descriptors() occasionally throws a KekulizeException #132

Open
hgandhi2411 opened this issue Feb 19, 2023 · 2 comments
Open

plot_descriptors() occasionally throws a KekulizeException #132

hgandhi2411 opened this issue Feb 19, 2023 · 2 comments

Comments

@hgandhi2411
Copy link
Contributor

Occurs for ECFP descriptors

---------------------------------------------------------------------------
KekulizeException                         Traceback (most recent call last)
/scratch/hgandhi/tmp/ipykernel_41403/692804871.py in <module>
      8         exmol.plot_descriptors(space, output_file=f"alprozolam_{d}.svg")
      9     else:
---> 10         svg = exmol.plot_descriptors(space, output_file=f"alprozolam_{d}.svg", return_svg=True)
     11         plt.close()
     12         skunk.display(svg)

/gpfs/fs2/scratch/hgandhi/exmol/exmol/exmol.py in plot_descriptors(examples, output_file, fig, figure_kwargs, title, return_svg)
   1253                     ringColor=None,
   1254                     extraColor=(0.8, 0.8, 0.8),
-> 1255                     useSVG=True,
   1256                 )
   1257                 # TODO: Why?

~/.conda/envs/exmol/lib/python3.7/site-packages/rdkit/Chem/Draw/IPythonConsole.py in DrawMorganBit(mol, bitId, bitInfo, drawOptions, **kwargs)
    302   else:
    303     fn = Draw.DrawMorganBit
--> 304   return _DrawBit(fn, mol, bitId, bitInfo, drawOptions=drawOptions, **kwargs)
    305 
    306 

~/.conda/envs/exmol/lib/python3.7/site-packages/rdkit/Chem/Draw/IPythonConsole.py in _DrawBit(fn, *args, **kwargs)
    275     kwargs['useSVG'] = ipython_useSVG
    276 
--> 277   res = fn(*args, **kwargs)
    278   if kwargs['useSVG']:
    279     return SVG(res)

~/.conda/envs/exmol/lib/python3.7/site-packages/rdkit/Chem/Draw/__init__.py 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)
    702 
    703 

~/.conda/envs/exmol/lib/python3.7/site-packages/rdkit/Chem/Draw/__init__.py in DrawMorganEnv(mol, atomId, radius, molSize, baseRad, useSVG, aromaticColor, ringColor, centerColor, extraColor, drawOptions, **kwargs)
    866                       highlightAtomColors=menv.atomColors, highlightBonds=menv.highlightBonds,
    867                       highlightBondColors=menv.bondColors, highlightAtomRadii=menv.highlightRadii,
--> 868                       **kwargs)
    869   drawer.FinishDrawing()
    870   return drawer.GetDrawingText()

KekulizeException: Can't kekulize mol.  Unkekulized atoms: 1 3 4 5 6 8 9
@whitead
Copy link
Contributor

whitead commented Feb 19, 2023

Is this just a drawing problem?

@hgandhi2411
Copy link
Contributor Author

Yes, this is a drawing problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants