Re: [Rdkit-discuss] No plot for H2 molecule?
Open-Source Cheminformatics and Machine Learning
Brought to you by:
glandrum
From: Greg L. <gre...@gm...> - 2016-10-18 14:05:06
|
Hi Stephanie, On Mon, Oct 17, 2016 at 7:58 PM, Stéphanie Valleau <sva...@st...> wrote: > For some reason I do not get a plot of H2 with the following code: > > mole = Chem.MolFromSmiles('[H][H]') > AllChem.Compute2DCoords(mole) > Draw.MolToFile(mole,name,size=(300,300)) > > I only get a white square in output, whereas other molecules such as > > mole = Chem.MolFromSmiles('[N][CH][OH]') > > plot with no trouble. > > I am running on MacOsX > > Any reason for this? > It looks like a bug in AllChem.Compute2DCoords: In [3]: m = Chem.MolFromSmiles('[H][H]') ...: AllChem.Compute2DCoords(m) ...: Out[3]: 0 In [4]: print(Chem.MolToMolBlock(m)) RDKit 2D 2 1 0 0 0 0 0 0 0 0999 V2000 nan nan 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 nan nan 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 1 2 1 0 M END I'll file that and we'll fix it. Thanks for finding and reporting the problem. Best, -greg |