Thanks, that's got all the properties. I was wondering about automatic format recognition. I found the FormatFactory and its guessFormat() methods, but this doesn't seem to recognise files of smiles strings (even though the SMILESReader can read the file), and it doesn't seem to recognise gzipped sdf files, even though the javadocs suggest it should. Is this the right way to do this?
Tim On 07/01/2015 20:50, John May wrote: > Hi Tim, > > You want MDLV2000Reader instead of MDLReader. > > J > > On Jan 6, 2015, at 6:27 PM, Tim Dudgeon <tdudgeon...@gmail.com> wrote: > >> I'm just starting to use CDK, so may not be doing things right, but it >> seems to me like the first property in a SD file is missing. >> I have code like this: >> >> InputStream ins = new FileInputStream(filename); >> MDLReader reader = new MDLReader(ins); >> ChemFile chemFile = (ChemFile) reader.read((ChemObject) new ChemFile()); >> List<IAtomContainer> containersList = >> ChemFileManipulator.getAllAtomContainers(chemFile); >> IMolecularDescriptor descriptor = new WienerNumbersDescriptor(); >> for (IAtomContainer mol : containersList) { >> System.out.println(mol.getProperties()); >> } >> >> The SD file properties bit of my file looks like this: >> >> M END >>> <mr_id> >> 4358263 >> >>> <SMI> >> Oc1cccc(c1)c2nc(N3CCOCC3)c4oc5ncccc5c4n2 >> >> $$$$ >> >> >> But what gets written out by CDK is this: >> >> {SMI=OC(=O)c1ccc(Nc2ncc3CN=C(c4c(F)cccc4F)c5cc(Cl)ccc5-c3n2)cc1} >> >> The first property (mr_id) is missing. >> This happens with 2 different files. >> >> Tim >> >> ------------------------------------------------------------------------------ >> Dive into the World of Parallel Programming! The Go Parallel Website, >> sponsored by Intel and developed in partnership with Slashdot Media, is your >> hub for all things parallel software development, from weekly thought >> leadership blogs to news, videos, case studies, tutorials and more. Take a >> look and join the conversation now. http://goparallel.sourceforge.net >> _______________________________________________ >> Cdk-user mailing list >> Cdk-user@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/cdk-user ------------------------------------------------------------------------------ New Year. New Location. New Benefits. New Data Center in Ashburn, VA. GigeNET is offering a free month of service with a new server in Ashburn. Choose from 2 high performing configs, both with 100TB of bandwidth. Higher redundancy.Lower latency.Increased capacity.Completely compliant. http://p.sf.net/sfu/gigenet _______________________________________________ Cdk-user mailing list Cdk-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/cdk-user