Hi Julio,

You can use this 

https://github.com/asad/SMSD/blob/master/src/org/openscience/smsd/tools/GraphAtomContainer.java

IAtomContainer container=new GraphAtomContainer(cdkAtomContainer);

Iterable<IAtom> sortedAtoms= container.atoms();

Hope this helps.

Asad



On 1 Apr 2011, at 13:03, cdk-user-requ...@lists.sourceforge.net wrote:

> Send Cdk-user mailing list submissions to
>       cdk-user@lists.sourceforge.net
> 
> To subscribe or unsubscribe via the World Wide Web, visit
>       https://lists.sourceforge.net/lists/listinfo/cdk-user
> or, via email, send a message with subject or body 'help' to
>       cdk-user-requ...@lists.sourceforge.net
> 
> You can reach the person managing the list at
>       cdk-user-ow...@lists.sourceforge.net
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Cdk-user digest..."
> 
> 
> Today's Topics:
> 
>   1. Sort atom types in IAtomContainer (Julio Peironcely)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Fri, 1 Apr 2011 10:15:29 +0200
> From: Julio Peironcely <pey...@gmail.com>
> Subject: [Cdk-user] Sort atom types in IAtomContainer
> To: cdk-user@lists.sourceforge.net
> Message-ID:
>       <AANLkTimffJ4o_N18rwbkgrHs9s6WHtFwRu3=s_+bf...@mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
> 
> Hello,
> 
> Is there a way of sorting the atoms that are included in an IAtomContainer?
> Example: I read into a IAtomContainer a SD file where the first atoms are
> oxygens, then carbons, and then nitrogens. I would like that in the
> IAtomContainer  the atoms are ordered C,O,N, for instance. If I would read a
> different SD with atoms ordered N,O,C, the resulting IAtomContainer will
> have again C,O,N.
> Is there a function in CDK that performs this?
> 
> Cheers,
> Julio
> 
> -- 
> Julio E. Peironcely, PhD student
> http://juliopeironcely.com
> Leiden/Amsterdam Center for Drug Research || Netherlands Metabolomics Centre
> peironc...@chem.leidenuniv.nl || pey...@gmail.com
> -------------- next part --------------
> An HTML attachment was scrubbed...
> 
> ------------------------------
> 
> ------------------------------------------------------------------------------
> Create and publish websites with WebMatrix
> Use the most popular FREE web apps or write code yourself; 
> WebMatrix provides all the features you need to develop and 
> publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
> 
> 
> ------------------------------
> 
> _______________________________________________
> Cdk-user mailing list
> Cdk-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/cdk-user
> 
> 
> End of Cdk-user Digest, Vol 59, Issue 1
> ***************************************

------------------------------------------------------------------------------
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself; 
WebMatrix provides all the features you need to develop and 
publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
_______________________________________________
Cdk-user mailing list
Cdk-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdk-user

Reply via email to