On Wed, Feb 11, 2015 at 10:43 PM, Soren Wacker <[email protected]> wrote:

>
> I am looking for a keyword to draw molecules black and white or greyscale
>
> e.g. Draw.MolsToImage(...,keyword?)
>
> is there something like this?
>
>
There's not a direct option for it, but you can easily get the color scheme
of your choice by using the DrawingOptions object:


In [1]: from rdkit import Chem
In [2]: from rdkit.Chem import AllChem
In [3]: from rdkit.Chem import Draw
In [4]: m = Chem.MolFromSmiles('c1ccc(O)c(N)c1F')
In [5]: AllChem.Compute2DCoords(m)
Out[5]: 0
In [6]: opt = Draw.DrawingOptions()
In [7]: from collections import defaultdict
In [8]: dd = defaultdict(lambda:(0,0,0))  # <- use a default color of black
In [11]: opt.elemDict=dd
In [12]: img = Draw.MolToImage(m,options=opt)

hope this helps,
-greg
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to