So (now that I've gotten the basics working on MacOS) I have a little
python program that generates an image from a SMILES string:

#!/usr/bin/env python
import argparse, sys

from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit.Chem import Draw
from rdkit.Chem.Draw.MolDrawing import MolDrawing
from rdkit.Chem.Draw.MolDrawing import DrawingOptions

parser = argparse.ArgumentParser()
parser.add_argument('-s', "--smiles", nargs='?', help="input smiles")
parser.add_argument('-o', "--output", type=str, default=sys.stdout)

args = parser.parse_args()
smiles = args.smiles
mol = AllChem.MolFromSmiles(smiles)

options = DrawingOptions()
options.atomLabelFontSize = 18
options.atomLabelFontFace = "sans"


Everything works as expected for PDF and PNG files:


./ -s "N[C@@H](C(C)C)C(O)=O" -o ~/tmp/valine.pdf

looks fine. But if I try that as a PDF, I get a big mess where the font
size is enormous (>100 pt) and the glyph isn't placed right.

This sounds similar to the problem described here:

although that seems to be some sort of Adobe problem.

I've tried a similar example (a couple of weeks, on a slightly earlier
version of Rdkit) on a different computer (running linux) and things look
good. Perhaps this is once again some library installation/configuration
issue, but I'm not sure what would be causing the problem.

Any ideas?


One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.;117567292;y
Rdkit-devel mailing list

Reply via email to