Eric,
On Sat, Jan 10, 2015 at 8:53 AM, Eric Smoll <[email protected]> wrote:
>
> Thank you for providing such a detailed answer so rapidly. It is greatly
> appreciated.
>
You're welcome.
> Yes, this is very close to what I am looking for. Here is my code. I
> couldn't get Compute2DCoords to work without setting the MolFromPDBFile
> "sanitize" keyword to "True" but it doesn't seem to cause any problems.
>
> n = Chem.MolFromPDBFile(filename1, removeHs=False, sanitize=True)
>
> for atom in n.GetAtoms():
> atom.SetNoImplicit(True)
> Chem.SanitizeMol(n)
> AllChem.Compute2DCoords(n)
> Draw.MolToFile(n, filename2)
>
Interesting. I don't think that should actually work (doing the initial
sanitization in MolFromPDBFile()), but I haven't dug into the code to look
at the details.
A bit of context. I am trying to automate the analysis of *reactive*
> chemical events computed by QM code. From the QM output files, I have built
> coordinate files (PDB) for every reactant molecule and every product
> molecule and I would like to render each in 2D using rdkit.
>
> Many reactions generate radical products and the above code will place the
> unpaired electron in the correct location. This is unexpected and very
> desirable. However, this same code snippet labels the atoms of an aromatic
> ring with radicals. This is an unwanted side-effect. I am looking for a
> solution to this problem. Do you have any suggestions? Does rdkit have
> features to detect and set an aromatic network? Is there an input file
> format that provides rdkit with the information necessary to detect simple
> aromatic rings?
>
There is aromatization code, but it relies on there being a network of
single, double, and possibly aromatic bonds to do its work.
> I am open to any solution convention that is not misleading. For example,
> removal of all radical "dots" in the rendered images should be satisfactory
> (aromatic character and radical character implied by connectivity).
>
Removing the radicals from the drawing would be quite straightforward: you
just need to call SetNumRadicalElectrons(0) on each atom before you call
the drawing routine.
> Alternatively, imposing a rule where any continuous ring of C-C or C-N
> bonds with bond-lengths below some threshold might be helpful in detecting
> and setting rings as aromatic. Other solutions might extract additional
> data from the QM output files to aid in properly rendering radical and
> aromatic rings.
>
The information required to do the assignment of aromatic networks is all
there (the ring information is available from Mol.GetRingInfo()), but
there's no code do automate the assignment of bond orders in the RDKit. The
automated assignment of bond orders based on distances is, in general, a
challenging topic. If you can really trust your geometries (since they are
coming from QM you probably can) and were to limit yourself to planar
rings, I would guess it's probably tractable.
-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