Re: [Rdkit-discuss] rdMolDraw2D drawing code
Open-Source Cheminformatics and Machine Learning
Brought to you by:
glandrum
|
From: Dimitri M. <dm...@bm...> - 2016-09-06 21:45:28
|
PS. looking at this, it may have come out a little confusing, so
I start with a 3D mol file and run it through
rdkit.Chem.AllChem.Compute2DCoords()
CID112084.svg is what comes out.
Running rdkit.Chem.AddHs() before Compute2DCoords() generates the layout
seen on other 3 pictures.
CID112084.allh.svg is what comes out after AddHs().
CID112084.nonum.svg is what comes out after
op = dr.drawOptions()
for i in range( mh.GetNumAtoms() ) :
op.atomLabels[i] = mh.GetAtomWithIdx( i ).GetSymbol()
CID112084.all.svg is with the above loop changed to
op.atomLabels[i] = mh.GetAtomWithIdx( i ).GetSymbol() + str ((i+1))
--
Dimitri Maziuk
Programmer/sysadmin
BioMagResBank, UW-Madison -- http://www.bmrb.wisc.edu
|