Dear Greg, Now I have found that Compute2DCoords(m) failing in Atom::getNumImplicitHs() on PRECONDITION(d_implicitValence>-1, "getNumImplicitHs() called without preceding call to calcImplicitValence()")
mol it trying to process: [*]NC(=N)N[*] >To have a chance at getting something reasonable for >fragments, you probably ought to generate 2D coordinates for the full >molecule, then manually set the positions of the atoms in the >fragment's conformer. And how I can do that? Regards, Evgueni 2009/7/6 Greg Landrum <greg.land...@gmail.com> > Dear Evgueni, > > > On Mon, Jul 6, 2009 at 8:03 PM, Evgueni Kolossov<ekolos...@gmail.com> > wrote: > > > > To display structure I need to put string MDLMol into the control. > > > > If I call compute2DCoords - it raised an exception but if do not - all > > > > atoms in one dot and you cannot see it at all The same is if I try to > > > > read call sanitizeMol. > > > > Looking like problem in Kekilizer because some of my fragments can > > > > contain atoms and bonds taken from the aromatic ring (and it must be so). > > > > Simple fragments like chain fragments displayed Ok because they are > > > > not causing exception in compute2Dcoords. > > RDKit::MolToMolBlock (or MolToMolFile) each take an optional kekulize > argument (the last one). If you set this to false, the mol file writer > will not attempt to kekulize aromatic bonds. Here's an example of > doing this from python: > ------------ > [72]>>> m = Chem.MolFromSmiles('cccc',sanitize=False) > [73]>>> AllChem.Compute2DCoords(m) > Out[73] 0 > [74]>>> print Chem.MolToMolBlock(m,kekulize=False) > > RDKit 2D > > 4 3 0 0 0 0 0 0 0 0999 V2000 > 0.0000 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 > -0.0000 -1.5000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 > -0.0000 -3.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 > -0.0000 -4.5000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 > 1 2 4 0 > 2 3 4 0 > 3 4 4 0 > M END > ------------ > > A note: as this example shows the coordinates generated by the > depictor for unsanitized molecules are likely to be less than > pleasing. To have a chance at getting something reasonable for > fragments, you probably ought to generate 2D coordinates for the full > molecule, then manually set the positions of the atoms in the > fragment's conformer. > > Best Regards, > -greg >