Hi Egon,

It works with MDLV2000Reader as suggested by you but not with MDLReader.

I was using MDLReader because the mols which I am handling are mixture 
of V3 and V2 formats in my Database.

Thanks

Asad

PS: Any suggestion how to automated it (may be its a naive question but 
the answer will be deeply appreciated :-) ).

Egon Willighagen wrote:
> On Fri, Nov 7, 2008 at 5:11 PM, Syed Asad Rahman <[EMAIL PROTECTED]> wrote:
>   
>> I tried fetching getMassNumber() on two mols by reading MDLReader. But
>> unfortunately it fails (gives same result for both) or I am missing
>> something.
>>
>> http://www.ebi.ac.uk/chebi/searchFreeText.do?searchString=37340
>>     
>
> Works for me:
>
>     @Test public void testReadingMISOLines() throws Exception {
>         String filename = "data/mdl/ChEBI_37340.mol";
>         logger.info("Testing: " + filename);
>         InputStream ins =
> this.getClass().getClassLoader().getResourceAsStream(filename);
>         MDLV2000Reader reader = new MDLV2000Reader(ins, Mode.STRICT);
>         ChemFile chemFile = (ChemFile)reader.read((ChemObject)new ChemFile());
>         Assert.assertNotNull(chemFile);
>         List containersList =
> ChemFileManipulator.getAllAtomContainers(chemFile);
>         Assert.assertEquals(1, containersList.size());
>         
> Assert.assertTrue(((IAtomContainer)containersList.get(0)).getAtomCount()
>   
>> 0);
>>     
>         Assert.assertEquals(210,
> ((IAtomContainer)containersList.get(0)).getAtom(0).getMassNumber().intValue());
>     }
>
> (commit to cdk1.2.x/ branch pending...)
>
> Egon
>
>   

-- 

****************************************************************

Syed Asad Rahman (BEngg, PhD)
Research Scientist

EMBL-EBI                                 Phone:+44-(0)1223-492537
Wellcome Trust Genome Campus             Fax:+44-(0)1223 494486
Hinxton CB10 1SD                         E-mail: [EMAIL PROTECTED]
Cambridge, UK                            Home Page: www.ebi.ac.uk/~asad

*****************************************************************



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Cdk-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cdk-user

Reply via email to