-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Apr 17, 2008, at 8:45 AM, Andreas Schüller wrote:
> Hello all!
>
> On 17/04/2008, Egon Willighagen <[EMAIL PROTECTED]> wrote:
>>>  Any more requests?  :)
>>>
>>>  Seriously, these are easy things to do, with quick usability  
>>> effects
>>>  for the user...
>
> I've got one.
> The simple task of reading a molecule from a mol2 file is overly
> complicated and actually only manageable for a CDK expert. Here's an
> example:
>
> IChemModel chemModel = (IChemModel) mol2Reader.read(
>      DefaultChemObjectBuilder.getInstance().newChemModel());
>
> IAtomContainer atomContainer = (IAtomContainer)
>      ChemModelManipulator.getAllAtomContainers(chemModel).get(0);
>
> IMolecule molecule =
>      DefaultChemObjectBuilder.getInstance().newMolecule 
> (atomContainer);

Indeed this is a hassle. See

http://cheminfo.informatics.indiana.edu/~rguha/code/java/#fread

for a code snippet that automatically detects the format and loads  
all the available molecules at one go into an array. Not a great idea  
for large multi-molecule SDF's or SMI's (you should use the  
Iterating*Reader), but much easier than going through the multiple  
levels of abstraction

- -------------------------------------------------------------------
Rajarshi Guha  <[EMAIL PROTECTED]>
GPG Fingerprint: D070 5427 CC5B 7938 929C  DD13 66A1 922C 51E7 9E84
- -------------------------------------------------------------------
Heisenberg may have slept here...


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Darwin)

iEYEARECAAYFAkgHbKEACgkQZqGSLFHnnoSdkACfUJJOm+AFWRhyF0r32fItCvy1
5wkAoLNhUirvupqTOr2zVAn0CZRTZc6W
=4qf5
-----END PGP SIGNATURE-----

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Cdk-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cdk-user

Reply via email to