Dear all,

I'm faced to a strange behavior using the MDLV2000Reader to read a  
simple SDF file containing properties.

When I use the reader to read a single IMolecule from a file (or a  
String: same issue), the properties are missing when I call the  
getProperties for this molecule.

Yet, if I ask the reader to read a ChemFile instead of reading a  
molecule, the properties are read correctly.

I suspect this is a bug; please confirm this so I could send a bug  
report. Here is a small snippet of code illustrating the problem:

public static void main(String [] args) throws Exception {
     File f = new File("benzene.sdf");
     MDLV2000Reader reader = new MDLV2000Reader(new FileReader(f));

     // Working...
//        ChemFile chemFile = (ChemFile)reader.read((ChemObject)new  
ChemFile());
//        List<IAtomContainer> containersList =  
ChemFileManipulator.getAllAtomContainers(chemFile);
//
//        IAtomContainer m = containersList.get(0);

     // Not working...
     IMolecule m = (IMolecule) reader.read(new Molecule());
     reader.close();

     System.out.println("Props: "+m.getProperties());
}

Here is the content of the benzene file:

   Marvin  07240915192D

   6  6  0  0  0  0            999 V2000
    -6.0991    3.9777    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    -6.8136    3.5652    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    -6.8136    2.7402    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    -6.0991    2.3277    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    -5.3846    2.7402    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    -5.3846    3.5652    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   1  2  1  0  0  0  0
   1  6  2  0  0  0  0
   2  3  2  0  0  0  0
   3  4  1  0  0  0  0
   4  5  2  0  0  0  0
   5  6  1  0  0  0  0
M  END
>  <molecule_name>
benzene

>  <foo_prop>
1.5684

$$$$

The same behavior occurs with various CDK-git version, which I  
retrieve from http://pele.farmbio.uu.se/nightly-jcp/, and also with  
the lastest stable version 1.2.7.

Cheers :)
Vincent


------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Cdk-user mailing list
Cdk-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdk-user

Reply via email to