On Fri, Feb 1, 2013 at 11:11 AM, JP <[email protected]> wrote: > I try setting the "kekulize=False" argument in this way: > > print Chem.MolToSmiles(core) > core.Debug() > # need kekulization before passing this to the drawing algorithm > Chem.Kekulize(core) > for r_id in rGroups.keys(): # rGoups is just a list of a few atoms indices I > want to label > core.GetAtomWithIdx(int(r_id)).SetProp("dummyLabel", "R" + r_id) > Draw.MolToFile(core, core_image, size=(600, 200), kekulize=False) > > But I get a ton of these when calling the debug and draw function: > > **** > > N/A imp: -1 hyb: 0 arom?: 0 chi: 0 > 29 8 O chg: 0 deg: 1 exp: [09:59:59] > > **** > Pre-condition Violation > getExplicitValence() called without call to calcExplicitValence() > Violation occurred on line 177 in file > /opt/RDKit_2012_12_1/Code/GraphMol/Atom.cpp > Failed Expression: d_explicitValence>-1 > ****
You need to call core.updatePropertyCache() before you call the other stuff. Molecules built from SMARTS do not have calculated valences. -greg ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_jan _______________________________________________ Rdkit-discuss mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

