On Fri, Sep 8, 2017 at 2:10 PM, Igor Filippov <igor.v.filip...@gmail.com>

>> Could it be that you didn't generate coordinates for the molecule?
>> The result is the same for me whether I load the molecule from an SD file
> with coordinates, or generate 2D or 3D coordinates on the fly.
> Does it display correctly for you?

Yeah, This snippet:

In [21]: m = Chem.MolFromSmiles('NC(=O)C(N)CCCC[NH3+]')

In [22]: nm = Draw.PrepareMolForDrawing(m)

In [23]: d = Draw.MolDraw2DCairo(200,200)

In [24]: d.DrawMolecule(nm)

In [25]: d.FinishDrawing()

In [26]: open('blah.png','wb+').write(d.GetDrawingText())
Out[26]: 2730

Produces the png file that's attached.

> BTW: rdMolDraw2D.PrepareMolForDrawing() is a useful function to know
>> about.
> I am doing it from c++, is there an equivalent there?

Sure, here's some testing code that uses it:

There are a bunch of other examples in that file too.

Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Rdkit-devel mailing list

Reply via email to