Re: [Cdk-user] Bug in IteratingSDFReader in 2.0 cdk?
Yes you're correct! Now things work again! Perfect! Best, Staffan 2017-07-24 12:37 GMT+02:00 John Mayfield: > There should be a blank line after M END? > > > Just checked and no there should not be a blank line. The current writer > does not generate this, after removing the erroneous blank lines I can > round trip it. > > try (SDFWriter sdfw = new SDFWriter(System.out)) { >> sdfw.setAlwaysV3000(true); >> while (sdfr.hasNext()) { >> sdfw.write(sdfr.next()); >> } >> } > > > Result: > > >> >> CDK 0724171132 >> >> 0 0 0 0 0999 V3000 >> M V30 BEGIN CTAB >> M V30 COUNTS 10 10 0 0 0 >> M V30 BEGIN ATOM >> M V30 1 C .0 .0 0 0 >> M V30 2 C .0 .0 0 0 >> M V30 3 C .0 .0 0 0 >> M V30 4 C .0 .0 0 0 >> M V30 5 C .0 .0 0 0 >> M V30 6 C .0 .0 0 0 >> M V30 7 N .0 .0 0 0 >> M V30 8 C .0 .0 0 0 >> M V30 9 C .0 .0 0 0 >> M V30 10 C .0 .0 0 0 >> M V30 END ATOM >> M V30 BEGIN BOND >> M V30 1 2 1 2 >> M V30 2 1 2 3 >> M V30 3 1 3 4 >> M V30 4 1 4 5 >> M V30 5 1 5 6 >> M V30 6 1 6 7 >> M V30 7 2 3 8 >> M V30 8 1 8 9 >> M V30 9 2 9 10 >> M V30 10 1 1 10 >> M V30 END BOND >> M V30 END CTAB >> M END >> > >> id1 >> >> >> >> CDK 0724171132 >> >> 0 0 0 0 0999 V3000 >> M V30 BEGIN CTAB >> M V30 COUNTS 11 11 0 0 0 >> M V30 BEGIN ATOM >> M V30 1 C .0 .0 0 0 >> M V30 2 C .0 .0 0 0 >> M V30 3 S .0 .0 0 0 >> M V30 4 O .0 .0 0 0 >> M V30 5 O .0 .0 0 0 >> M V30 6 C .0 .0 0 0 >> M V30 7 C .0 .0 0 0 >> M V30 8 C .0 .0 0 0 >> M V30 9 C .0 .0 0 0 >> M V30 10 C .0 .0 0 0 >> M V30 11 C .0 .0 0 0 >> M V30 END ATOM >> M V30 BEGIN BOND >> M V30 1 1 1 2 >> M V30 2 1 2 3 >> M V30 3 2 3 4 >> M V30 4 2 3 5 >> M V30 5 1 2 6 >> M V30 6 2 6 7 >> M V30 7 1 7 8 >> M V30 8 2 8 9 >> M V30 9 1 9 10 >> M V30 10 2 10 11 >> M V30 11 1 6 11 >> M V30 END BOND >> M V30 END CTAB >> M END >> > >> id2 >> >> > > > On 24 July 2017 at 11:15, John Mayfield > wrote: > >> Which version did you generate it with? There should be a blank line >> after M END? >> >> John >> >> On 24 July 2017 at 11:03, Staffan Arvidsson >> wrote: >> >>> I just bumped the CDK version in our code repo (from 1.5.13) and found >>> that some of my tests are now failing. The issue is reading v3000 SDF files >>> were properties are not set on the molecules. I attached the file that I've >>> used in one of tests. Basic code for showing things are not working: >>> >>> IteratingSDFReader iter = new IteratingSDFReader(new >>> FileInputStream(file), SilentChemObjectBuilder.getInstance()); >>> >>> while(iter.hasNext()){ >>> >>> System.out.println(iter.next().getProperties()); >>> } >>> >>> The output is simply an empty map. Or did I miss something here? >>> >>> Also, I've found that the keys in properties are somehow 'cleaned' by >>> switching out space, dots, equal signs to lower case character? Any reason >>> behind this? >>> >>> >>> Best, >>> Staffan >>> >>> >>> -- >>> Check out the vibrant tech community on one of the world's most >>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot >>> ___ >>> Cdk-user mailing list >>> Cdk-user@lists.sourceforge.net >>> https://lists.sourceforge.net/lists/listinfo/cdk-user >>> >>> >> > -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot___ Cdk-user mailing list Cdk-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/cdk-user
Re: [Cdk-user] Bug in IteratingSDFReader in 2.0 cdk?
> > There should be a blank line after M END? Just checked and no there should not be a blank line. The current writer does not generate this, after removing the erroneous blank lines I can round trip it. try (SDFWriter sdfw = new SDFWriter(System.out)) { > sdfw.setAlwaysV3000(true); > while (sdfr.hasNext()) { > sdfw.write(sdfr.next()); > } > } Result: > > CDK 0724171132 > > 0 0 0 0 0999 V3000 > M V30 BEGIN CTAB > M V30 COUNTS 10 10 0 0 0 > M V30 BEGIN ATOM > M V30 1 C .0 .0 0 0 > M V30 2 C .0 .0 0 0 > M V30 3 C .0 .0 0 0 > M V30 4 C .0 .0 0 0 > M V30 5 C .0 .0 0 0 > M V30 6 C .0 .0 0 0 > M V30 7 N .0 .0 0 0 > M V30 8 C .0 .0 0 0 > M V30 9 C .0 .0 0 0 > M V30 10 C .0 .0 0 0 > M V30 END ATOM > M V30 BEGIN BOND > M V30 1 2 1 2 > M V30 2 1 2 3 > M V30 3 1 3 4 > M V30 4 1 4 5 > M V30 5 1 5 6 > M V30 6 1 6 7 > M V30 7 2 3 8 > M V30 8 1 8 9 > M V30 9 2 9 10 > M V30 10 1 1 10 > M V30 END BOND > M V30 END CTAB > M END > > > id1 > > > > CDK 0724171132 > > 0 0 0 0 0999 V3000 > M V30 BEGIN CTAB > M V30 COUNTS 11 11 0 0 0 > M V30 BEGIN ATOM > M V30 1 C .0 .0 0 0 > M V30 2 C .0 .0 0 0 > M V30 3 S .0 .0 0 0 > M V30 4 O .0 .0 0 0 > M V30 5 O .0 .0 0 0 > M V30 6 C .0 .0 0 0 > M V30 7 C .0 .0 0 0 > M V30 8 C .0 .0 0 0 > M V30 9 C .0 .0 0 0 > M V30 10 C .0 .0 0 0 > M V30 11 C .0 .0 0 0 > M V30 END ATOM > M V30 BEGIN BOND > M V30 1 1 1 2 > M V30 2 1 2 3 > M V30 3 2 3 4 > M V30 4 2 3 5 > M V30 5 1 2 6 > M V30 6 2 6 7 > M V30 7 1 7 8 > M V30 8 2 8 9 > M V30 9 1 9 10 > M V30 10 2 10 11 > M V30 11 1 6 11 > M V30 END BOND > M V30 END CTAB > M END > > > id2 > > On 24 July 2017 at 11:15, John Mayfieldwrote: > Which version did you generate it with? There should be a blank line after > M END? > > John > > On 24 July 2017 at 11:03, Staffan Arvidsson > wrote: > >> I just bumped the CDK version in our code repo (from 1.5.13) and found >> that some of my tests are now failing. The issue is reading v3000 SDF files >> were properties are not set on the molecules. I attached the file that I've >> used in one of tests. Basic code for showing things are not working: >> >> IteratingSDFReader iter = new IteratingSDFReader(new >> FileInputStream(file), SilentChemObjectBuilder.getInstance()); >> >> while(iter.hasNext()){ >> >> System.out.println(iter.next().getProperties()); >> } >> >> The output is simply an empty map. Or did I miss something here? >> >> Also, I've found that the keys in properties are somehow 'cleaned' by >> switching out space, dots, equal signs to lower case character? Any reason >> behind this? >> >> >> Best, >> Staffan >> >> >> -- >> Check out the vibrant tech community on one of the world's most >> engaging tech sites, Slashdot.org! http://sdm.link/slashdot >> ___ >> Cdk-user mailing list >> Cdk-user@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/cdk-user >> >> > -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot___ Cdk-user mailing list Cdk-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/cdk-user
Re: [Cdk-user] Bug in IteratingSDFReader in 2.0 cdk?
Which version did you generate it with? There should be a blank line after M END? John On 24 July 2017 at 11:03, Staffan Arvidssonwrote: > I just bumped the CDK version in our code repo (from 1.5.13) and found > that some of my tests are now failing. The issue is reading v3000 SDF files > were properties are not set on the molecules. I attached the file that I've > used in one of tests. Basic code for showing things are not working: > > IteratingSDFReader iter = new IteratingSDFReader(new > FileInputStream(file), SilentChemObjectBuilder.getInstance()); > > while(iter.hasNext()){ > > System.out.println(iter.next().getProperties()); > } > > The output is simply an empty map. Or did I miss something here? > > Also, I've found that the keys in properties are somehow 'cleaned' by > switching out space, dots, equal signs to lower case character? Any reason > behind this? > > > Best, > Staffan > > > -- > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > ___ > Cdk-user mailing list > Cdk-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/cdk-user > > -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot___ Cdk-user mailing list Cdk-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/cdk-user
[Cdk-user] Bug in IteratingSDFReader in 2.0 cdk?
I just bumped the CDK version in our code repo (from 1.5.13) and found that some of my tests are now failing. The issue is reading v3000 SDF files were properties are not set on the molecules. I attached the file that I've used in one of tests. Basic code for showing things are not working: IteratingSDFReader iter = new IteratingSDFReader(new FileInputStream(file), SilentChemObjectBuilder.getInstance()); while(iter.hasNext()){ System.out.println(iter.next().getProperties()); } The output is simply an empty map. Or did I miss something here? Also, I've found that the keys in properties are somehow 'cleaned' by switching out space, dots, equal signs to lower case character? Any reason behind this? Best, Staffan MDLv3000.sdf Description: Binary data -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot___ Cdk-user mailing list Cdk-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/cdk-user