Aromatic bonds (bond order 4) are a query feature and should NOT be used to
store structures. The reason is otherwise the implicit hydrogen placement must
be guessed. It’s easier to demonstrate this error propagation with SMILES, same
structure in, different structures out:
> [hal ~]: obabel -:'c1ncnc1C.Cc1ncnc1' -o smi
> c1[nH]cnc1C.Cc1[nH]cnc1
I actually saw this mentioned in a talk by Tony W today and would strongly
recommended pipping your structure through http://cvsp.chemspider.com/ to get
the list of errors.
How are you reading/writing there should be a warning in the molfile writers
for bond order 4? If not that’s a bug.
> FixBondOrdersTool.kekuliseAromaticRings
Should be deprecated - I don’t know why it doesn’t work here but having looked
at it before it is very incomplete. The new Kekulization class should be what
you need. Unfortunately a SINGLE_OR_DOUBLE flag is set on the bond when the
algorithm expects aromatic flags on atoms. This is a simple jig around (see
example) – sorry this isn’t easier but it’s a disconnected between different
developers.
MDLV2000Reader mdlr = new MDLV2000Reader(new StringReader(molfileStr));
IAtomContainer mol = mdlr.read(new AtomContainer());
// query molecule so need to guess hydrogen counts, do not do this in
// general, normal molfiles will have them set on read!
AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol);
CDKHydrogenAdder.getInstance(mol.getBuilder()).addImplicitHydrogens(mol);
for (IBond bond : mol.bonds()) {
if (bond.getFlag(CDKConstants.SINGLE_OR_DOUBLE)) {
bond.setFlag(CDKConstants.ISAROMATIC, true); // optional
bond.getAtom(0).setFlag(CDKConstants.ISAROMATIC, true);
bond.getAtom(1).setFlag(CDKConstants.ISAROMATIC, true);
}
}
Kekulization.kekulize(mol);
new MDLV2000Writer(System.out).write(mol);
> Moreover, I was told in an earlier email that I should recreate a new
> molecule after adding hydrogens (because all added hydrogens had the same set
> of coordinates at 0.000). However, as you can see, thehydrogen atoms in
> molecule MOL2 (even the one in MOL 1 that had non-zero x and y coordinates)
> have the coordinates (0,0,0).
Recreate…? you need to assign coordinates (layout) if implicit hydrogens are
converted to explicit. There is possibly an SDG (layout) call somewhere already
in your code. In MOL1 the H has been laid out by someone else or a previous
invocation.
J
On Apr 21, 2015, at 10:41 PM, Yannick .Djoumbou <y.djoum...@gmail.com> wrote:
> Hello all,
>
>
> Regarding kekulization, should the bond type change from 4 to 1 and/or 2? If
> I have the following file, what does the function
> FixBondOrdersTool.kekuliseAromaticRings(IAtomContainer) change actually? I am
> a bit confused. When I apply the function to the molecie MOL 1 below after
> adding explicit H atoms (Not necessary in general but it's part of my costum
> function), I get the molecule MOL2. The bond types remain the same. Moreover,
> I was told in an earlier email that I should recreate a new molecule after
> adding hydrogens (because all added hydrogens had the same set of coordinates
> at 0.000). However, as you can see, thehydrogen atoms in molecule MOL2 (even
> the one in MOL 1 that had non-zero x and y coordinates) have the coordinates
> (0,0,0).
>
> Thanks for your consideration.
>
> MOL1
> 10 10 0 0 0 0 0 0 0 0999 V2000
> -2.8875 -2.9759 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
> -3.7125 -2.9759 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
> -2.0625 -2.9759 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
> -2.8875 -3.8009 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0
> -1.6500 -3.6904 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
> -0.8250 -3.6904 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
> -0.4125 -2.9759 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
> -0.8250 -2.2614 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
> -1.6500 -2.2614 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
> 0.4125 -2.9759 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
> 1 2 1 0 0 0 0
> 1 3 1 0 0 0 0
> 1 4 1 0 0 0 0
> 3 5 4 0 0 0 0
> 3 9 4 0 0 0 0
> 5 6 4 0 0 0 0
> 6 7 4 0 0 0 0
> 7 8 4 0 0 0 0
> 8 9 4 0 0 0 0
> 7 10 1 0 0 0 0
> M END
> $$$$
>
> MOL2
> CDK 0421151530
>
> 16 16 0 0 0 0 0 0 0 0999 V2000
> 1.2990 -0.7500 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
> 1.2990 -2.2500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
> 0.0000 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
> 2.5981 -0.0000 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0
> 0.0000 1.5000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
> -1.2990 2.2500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
> -2.5981 1.5000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
> -2.5981 -0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
> -1.2990 -0.7500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
> -3.8971 2.2500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
> 2.5981 -3.0000 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0
> -0.1782 -1.9895 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0
> 0.7860 -3.6595 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0
> -3.8971 3.7500 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0
> -5.3743 2.5105 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0
> -4.4101 0.8405 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0
> 1 2 1 0 0 0 0
> 1 3 1 0 0 0 0
> 1 4 1 0 0 0 0
> 3 5 4 0 0 0 0
> 3 9 4 0 0 0 0
> 5 6 4 0 0 0 0
> 6 7 4 0 0 0 0
> 7 8 4 0 0 0 0
> 8 9 4 0 0 0 0
> 7 10 1 0 0 0 0
> 2 11 1 0 0 0 0
> 2 12 1 0 0 0 0
> 2 13 1 0 0 0 0
> 10 14 1 0 0 0 0
> 10 15 1 0 0 0 0
> 10 16 1 0 0 0 0
> M END
> $$$$
------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Cdk-user mailing list
Cdk-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdk-user