Hi,
The LengthOverBreadthDescriptor returns only NaNs, even with 3D input data.
ISimpleChemObjectReader reader = new ReaderFactory().createReader(new FileReader( "/tmp/30_random_cpdbas_compounds.ob3d.sdf")); IChemFile content = (IChemFile) reader.read((IChemObject) new ChemFile()); for (IAtomContainer mol : ChemFileManipulator.getAllAtomContainers(content)) { IMolecularDescriptor desc = new LengthOverBreadthDescriptor(); System.out.println(desc.calculate(mol).getValue()); } reader.close();
You need make sure the mass is set for the centre of mass calc.
The error was written to the exception:
You also need to tell the MDL reader to load as 3D. I don't know how it's done on the reader factory.
Last edit: John May 2015-02-22