I've noticed that if you try to depict a structure in molfile format
that has bonds in rings defined as aromatic type then they are depicted
as any bonds (dashed), not aromatic (donuts). For example take this molfile:
Mrv17a0 10061711272D
14 15 0 0 0 0 999 V2000
0.5420 0.2323 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
1.2564 -0.1802 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
1.2564 -1.0052 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
1.9239 -1.4901 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
2.7085 -1.2352 0.0000 S 0 0 0 0 0 0 0 0 0 0 0 0
3.3216 -1.7872 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
1.6689 -2.2748 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
0.8439 -2.2748 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
0.5890 -1.4901 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.1956 -1.2352 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.8631 -1.7201 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-1.5305 -1.2352 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-1.2756 -0.4506 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.4506 -0.4506 0.0000 S 0 0 0 0 0 0 0 0 0 0 0 0
1 2 1 0 0 0 0
2 3 1 0 0 0 0
3 4 4 0 0 0 0
4 5 1 0 0 0 0
5 6 1 0 0 0 0
4 7 4 0 0 0 0
7 8 4 0 0 0 0
8 9 4 0 0 0 0
3 9 4 0 0 0 0
9 10 1 0 0 0 0
10 11 4 0 0 0 0
11 12 4 0 0 0 0
12 13 4 0 0 0 0
13 14 4 0 0 0 0
10 14 4 0 0 0 0
M END
Some of the bonds are clearly aromatic (4 in the 3rd column of the bond
block). But when rendering with code like this you get those bonds
depicted as dashed bonds:
String mol = ...
DepictionGenerator dg = new DepictionGenerator()
.withTerminalCarbons()
.withSize(500d, 400d)
.withFillToFit()
MDLV2000Reader v2000Parser = new MDLV2000Reader(new
ByteArrayInputStream(mol.getBytes()))
IAtomContainer atomContainer = v2000Parser.read(new AtomContainer())
Depiction depiction = dg.depict(atomContainer)
depiction.writeTo("png", "/tmp/mol.png")
This is using either CDK 2.0 or 2.1.
If you try a similar thing with the same molecule in smiles format the
behaviour is a bit different.
String mol2 = 'CCn1c(SC)nnc1-c1cccs1'
SmilesParser parser = new
SmilesParser(SilentChemObjectBuilder.getInstance())
IAtomContainer atomContainer2 = parser.parseSmiles(mol2)
In this case the molecule gets depicted in kekule form. This seems to be
because by default the smiles parser kekulises the molecule (unlike the
MDLV2000Reader) though you can turn this off:
parser.kekulise(false)
in which case you get the molecule depicted with dashed bonds again.
So the key questions:
1. Why the inconsistency in how the different parsers/readers behave? Is
this documented anywhere?
2. Is it possible to have the aromatic bonds depicted as proper aromatic
bonds?
Tim
------------------------------------------------------------------------------
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