Wow, this almost makes me wanting to re-write my thesis in LaTeX. Almost!
:)

George


On 15 August 2012 16:26, Greg Landrum <[email protected]> wrote:

> On Wed, Aug 15, 2012 at 5:10 PM, Michael Palmer <[email protected]>
> wrote:
> >
> >> Now that I've at least tried to clear up what is going on, maybe I can
> >> be more helpful: was there a specific question you were trying to
> >> answer that led you to your discovery that the RDKit behaves strangely
> >> in this special case?
> >
> >
> > What I'm trying to do can be inspected here:
> >
> > http://chimpsky.uwaterloo.ca/mol2chemfig/index
> >
> > Briefly, I'm building a program for converting molecular structures from
> > smiles or molfile format to TeX code, using the syntax defined by the
> > chemfig package as the target.
>
> oooo, coool!
>
> > rdkit does all the heavy lifting. I was using
> > the GetImplicitHs method to determine how many hydrogens to attach to
> > carbons and heteroatoms and then noticed that the number of hydrogens on
> > nitrogen in rings was off.
> >
> > From your answer, it seems I should be using GetTotalNumHs. However, I
> would
> > still like to be able to distinguish between hydrogens that were
> specified
> > in a molfile, with coordinates, and those that weren't.
>
> the answer to this isn't super straightforward, so it probably won't
> come until tomorrow.
>
> >
> > Another question I ran into was accessing the coordinates of an atom,
> either
> > loaded from molfile or, with smiles, computed with
> AllChem.Compute2DCoords.
> > Does the atom object have a method to get at those? Right now, I'm using
> > some embarrassing workaround.
>
> This one I can answer quickly. You need to the molecule's conformer:
> In [7]: AllChem.Compute2DCoords(m)
> Out[7]: 0
>
> In [8]: conf = m.GetConformer()
>
> In [9]: for atom in m.GetAtoms():
>    ...:     aid = atom.GetIdx()
>    ...:     print aid,list(conf.GetAtomPosition(aid))
>    ...:
> 0 [0.15858546683951269, -1.1294387542967057, 0.0]
> 1 [-1.3046720119188515, -1.4594047386916416, 0.0]
> 2 [-2.3220596761687866, -0.35716958200679838, 0.0]
> 3 [-1.8761898616603592, 1.07503155907298, 0.0]
> 4 [-0.41293238290199596, 1.4049975434679163, 0.0]
> 5 [0.60445528134793969, 0.30276238678307321, 0.0]
> 6 [2.0677127601063026, 0.63272837117800962, 0.0]
> 7 [3.0851004243562379, -0.46950678550683356, 0.0
>
> -greg
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Rdkit-discuss mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to