It's a standard sdf file. The molecules have 3D coordinates indeed. But some's z coordinates are all zero. So I just wonder how I can calculate TPSA for this kind of molecule. Below is an example file. One molecule is OK, but for the other will get a NullPointerException. You can look at it. I hope someone could help me out. Thanks.
On Sun, Dec 21, 2014 at 3:33 AM, Egon Willighagen < egon.willigha...@gmail.com> wrote: > On Fri, Dec 19, 2014 at 11:42 PM, Zheng Shi <zs...@ualberta.ca> wrote: > > When I look at these molecules which report exception, I find their z > > coordinates are all 0. I just wonder whether this does effect on > > calculating TPSA. If so, how can I calculate TPSA for these? Thanks. > > Is your input perhaps from a MDL molfile? Those files do not > explicitly say if the coordinates are 2D or 3D and the heuristics have > the side effect that planar molecules in the XY plane are > misinterpreted as 2D. > > However, you can force them to be read as 3D with this: > > InputStream ins = > this.getClass().getClassLoader().getResourceAsStream(filename); > MDLV2000Reader reader = new MDLV2000Reader(ins); > Properties prop = new Properties(); > prop.setProperty("ForceReadAs3DCoordinates", "true"); > PropertiesListener listener = new PropertiesListener(prop); > reader.addChemObjectIOListener(listener); > reader.customizeJob(); > > IAtomContainer mol = reader.read(new AtomContainer()); > > Does that help? > > Egon > > > -- > E.L. Willighagen > Department of Bioinformatics - BiGCaT > Maastricht University (http://www.bigcat.unimaas.nl/) > Homepage: http://egonw.github.com/ > LinkedIn: http://se.linkedin.com/in/egonw > Blog: http://chem-bla-ics.blogspot.com/ > PubList: http://www.citeulike.org/user/egonw/tag/papers > ORCID: 0000-0001-7542-0286 > ImpactStory: https://impactstory.org/EgonWillighagen > >
example.sdf
Description: Binary data
------------------------------------------------------------------------------ Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration & more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________ Cdk-user mailing list Cdk-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/cdk-user