Technically 2.3 isn't officially release yet as not had time to do the patch notes ;-), but feel free to use it.
You can just remove the stereo information? The wedge/hatch info is display only, the actual information is stored as a list of stereo elements. You can clear this: > mol.setStereoElements(new ArrayList<IStereoElement>()); Again if you've already generated a layout when stereo is there you will need to clear the bond display. This is actually one of the reasons I added the "bond display" to emphasise it really is only a display option and the stereo info isn't stored there. On Wed, 21 Aug 2019 at 14:51, Tim Dudgeon <[email protected]> wrote: > I'm using the 2.3 release. > > Using bond.setDisplay(IBond.Display.Solid) does work, but there's a big > gotcha. If the molecule still needs to be layed out (e.g. no 2D > coordinates) then when the DepictionGenerator does the layout the bond's > display property gets reset to the chiral representation. > > The workaround is to make sure that 2D coordinates are present (e.g. using > StructureDiagramGenerator) and then set the display property. > > Tim > > > On 20/08/2019 17:31, John Mayfield wrote: > > Are you using the very latest release? I think it's an over site. Try > > bond.setDisplay(IBond.Display.Solid); > > > On Tue, 20 Aug 2019 at 16:40, Tim Dudgeon <[email protected]> wrote: > >> Hi, I'm wanting to depict a molecule without sterochemistry, but the >> DepictionGenerator stubbornly seems to add it back. >> What is the way to do this? In the example below a squiggle bond is >> displayed even though all bonds have been set to Stereo.NONE and I have >> already layed out the molecule. >> >> void "no stereo"() { >> >> IAtomContainer mol = ChemUtils.readSmiles("c1ccc(N=C2SCCN2c2ccccc2)cc1") >> StructureDiagramGenerator sdg = new StructureDiagramGenerator(); >> sdg.setMolecule(mol); >> sdg.generateCoordinates(new Vector2d(0, 1)); >> mol = sdg.getMolecule(); >> for (IBond bond : mol.bonds()) { >> bond.setStereo(IBond.Stereo.NONE); >> } >> DepictionGenerator g = new DepictionGenerator() >> Depiction d = g.depict(mol) >> >> when: >> def img = d.toImg() >> ByteArrayOutputStream out = new ByteArrayOutputStream(); >> ImageIO.write(img, "png", out); >> out.close(); >> byte[] png = out.toByteArray(); >> Files.write(java.nio.file.Paths.get("/tmp/myimage5.png"), png) >> >> then: >> png != null png.length > 0} >> >> >> _______________________________________________ >> Cdk-user mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/cdk-user >> >
_______________________________________________ Cdk-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/cdk-user

