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

-- 
----
http://chem-bla-ics.blogspot.com/

-------------------------------------------------------------------------
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