Dear Yannick, On Wed, Oct 29, 2014 at 10:47 PM, Yannick .Djoumbou <y.djoum...@gmail.com> wrote: > I am using IteratingMDLReader to iterate over a SDF file and do some > operations on the molecules. I would like to get the name for each compound, > so that I can easily assign the results of the operations. Is there a way to > get the names?
If you have this name in the header of the MDL molfile block, you can use: mol.getProperty(CDKConstants.TITLE) If it is in a property, like <NAME>, then you can use something like: writer = new SDFWriter( new FileWriter("ctr/ctr4.sdf") ) while (iterator.hasNext()) { mol = iterator.next() if (mol.getProperty("NAME") == null) { // do something } } 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 ------------------------------------------------------------------------------ _______________________________________________ Cdk-user mailing list Cdk-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/cdk-user