[Rdkit-discuss] Fwd: highlightColor in Draw.MolsToGridImage()
Open-Source Cheminformatics and Machine Learning
Brought to you by:
glandrum
|
From: DmitriR <xz...@gm...> - 2016-07-18 08:14:34
|
Dear all, Thanks again for the very useful comments. Re. PNG quality, I installed cairocffi via conda, and now the images look great. (Could be useful to add a suggestion to do this to the conda install instructions on the Install page) However, I still don't seem to have rdMolDraw2D.MolDraw2DCairo() (code below). Thus the PNG generation options per http://nbviewer.jupyter.org/github/rdkit/UGM_2015/blob/master/Notebooks/Whats_new.ipynb do not work. Does this mean I need to *build* rdkit with cairocffi libraries? (as opposed to using a conda install) http://www.rdkit.org/docs/Install.html doesn't say much about cairo. There are several alternative build strategies (with homebrew and conda harnesses, straight from source). I looked at the descriptions and ran some experiments with no particular success. Before I dig deeper into the build scripts: Could somebody perhaps recommend the (build or install) procedure to get full PNG drawing functionality for python3 on OSX? Thanks! Best, Dmitri == % conda install -c rdkit rdkit ... import rdkit from rdkit import Chem from rdkit.Chem import Draw from rdkit.Chem.Draw import rdMolDraw2D rdkit.__version__ '2016.03.1' import cairocffi cairocffi.__path__ ['/Users/dmitri/anaconda3/lib/python3.5/site-packages/cairocffi'] hasattr(rdMolDraw2D,'MolDraw2DCairo') False > Begin forwarded message: > > From: DmitriR <xz...@gm...> > Subject: Re: [Rdkit-discuss] highlightColor in Draw.MolsToGridImage() > Date: July 17, 2016 at 2:42:26 PM EDT > To: Greg Landrum <gre...@gm...> > Cc: RDKit Discuss <rdk...@li...> > >> Also a couple of related questions (that might have an analogous answer): >> >> (1) is there a way to change the resolution of the PNG images produced by Draw.MolToImage(mol)? >> The resulting images look low-res and pretty jagged on my screen. >> I can change the size, but I couldn't find anything in the API for the resolution. >> >> The jagged images are typically because you don't have either aggdraw or cairo installed. When this is the case, the RDKit uses a lowest-common-denominator approach to drawing that is better than nothing, but still looks pretty crappy. > > Yes, this must be it. > I am just using the conda rdkit install > OSX with python 3.5: rdkit 2016.03.1 np110py35_0 > > Thanks. > Dmitri |