Hi Mark, it's best to add the hydrogens first and then set your coordinates:
m=Chem.MolFromSmiles('Nc1nnc2n1CCS2') m2=rdmolops.AddHs(m, False, True); Chem.rdCoordGen.AddCoords(m2) Best, Fio On Thu, Aug 27, 2020 at 11:25 AM Mark Mackey <m...@cresset-group.com> wrote: > Hi all, > > > > I’m trying to generate a 2D layout with sensible locations for hydrogens, > and am struggling a bit. If I start from SMILES: > > > > m=Chem.MolFromSmiles('Nc1nnc2n1CCS2') > > m2=rdmolops.AddHs(m, False, True); > > > > Then m2 has perfectly sensible 2D cords for the hydrogens. If I use > addCoords=False here then the hydrogens are all at the origin, which is > more-or-less expected. > > > > If, however, I generate new 2D coords for the heavy atoms with CoordGen: > > > > m=Chem.MolFromSmiles('Nc1nnc2n1CCS2') > > Chem.rdCoordGen.AddCoords(m) > > m2=rdmolops.AddHs(m, False, True); > > > > then the 2D coords for the hydrogens are poor on the 5-membered ring, and > the two hydrogens on the NH2 are superimposed. > > > > (In practise I’m starting from a 3D SDF and trying to generate 2D coords > for it, hence the need for CoordGen). > > > > What am I doing wrong? > > > > Regards, > > Mark > > > > *-- * > > *Mark Mackey* > > *Chief Scientific Officer* > > *Cresset* > > New Cambridge House, Bassingbourn Road, Litlington, Cambridgeshire, SG8 > 0SS, UK > > tel: +44 (0)1223 858890 mobile: +44 (0)7595 099165 fax: +44 (0)1223 > 853667 > > email: *m...@cresset-group.com <m...@cresset-group.com>* web: > www.cresset-group.com skype: mark_cresset > > > _______________________________________________ > Rdkit-discuss mailing list > Rdkit-discuss@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/rdkit-discuss >
_______________________________________________ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss