Hi Nick,
On Mar 19, 2013, at 5:00 PM, Nicholas Firth <[email protected]> wrote:
> Hi RDKitters,
>
> I'm sure this must of been covered somewhere else but I can't find it in the
> forum or the source.
>
> I am manipulating SMILES strings and wonder whether I can use RDKit as a
> shortcut, so my question is does the order of occurrence in a SMILES string
> of an atom match the atom index that is given by RDKit. It seems to me that
> it does but I'd like to know for all cases. For example
>
> >>> from rdkit import Chem
> >>> mol=Chem.MolFromSmiles('CSNOC')
> >>> for atom in mol.GetAtoms(): print atom.GetAtomicNum(),atom.GetIdx()
> ...
> 6 0
> 16 1
> 7 2
> 8 3
> 6 4
>
> This is what I would expect, but is there a case when this order might not be
> conserved?
The atom and bond order will be preserved unless the smiles contains hydrogens
as explicit atoms, i.e. as [H]. In that case, the hydrogens are removed and the
remaining indices are what your would expect.
> If the order isn't always conserved, how does the indexing cope with RDKit
> canonical smiles?
I don't understand the question but maybe that doesn't matter since the order
is preserved?
-greg
> Thanks in advance.
>
> Best,
> Nick
>
> Nicholas C. Firth | PhD Student | Cancer Therapeutics
> The Institute of Cancer Research | 15 Cotswold Road | Belmont | Sutton |
> Surrey | SM2 5NG
> T 020 8722 4033 | E [email protected] | W www.icr.ac.uk | Twitter
> @ICRnews
> Facebook www.facebook.com/theinstituteofcancerresearch
>
> Making the discoveries that defeat cancer
>
>
> <image001.gif>
>
>
> The Institute of Cancer Research: Royal Cancer Hospital, a charitable Company
> Limited by Guarantee, Registered in England under Company No. 534147 with its
> Registered Office at 123 Old Brompton Road, London SW7 3RP.
>
> This e-mail message is confidential and for use by the addressee only. If the
> message is received by anyone other than the addressee, please return the
> message to the sender by replying to it and then delete the message from your
> computer and network.
> ------------------------------------------------------------------------------
> 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_mar
> _______________________________________________
> Rdkit-discuss mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
------------------------------------------------------------------------------
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_mar
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss