Re: [Cdk-user] depiction without stereochemistry

2019-08-20 Thread John Mayfield
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  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=C2SCCN2c2c2)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 != nullpng.length > 0}
>
>
> ___
> Cdk-user mailing list
> Cdk-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/cdk-user
>
___
Cdk-user mailing list
Cdk-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdk-user


[Cdk-user] depiction without stereochemistry

2019-08-20 Thread Tim Dudgeon
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=C2SCCN2c2c2)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
Cdk-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdk-user