From: Wayne V. <vol...@re...> - 2003-12-12 05:33:53
|
Hi Joerg, A couple weeks ago I asked about the bond type "4" in the sd files produced by JOELib. You said > ah, o.k., but that's not a bug that's a feature! These bonds are=20 > aromatic and you will find this also in the SD-FILE definition of MDL. > That why you should use JOELib or OpenBabel, because they have a really=20 > great chemical expert system behind 'simple' file conversion. Only if=20 > you know aromatic atoms/bonds you can create e.g. a MOL2 file !!! I went and looked at the sd file definition on the mdl web site. A bond type of "4" is only permitted (required?) for structures intended for use as queries (against, presumably, a database). I'm sure you'll find that particular distinction as odd as I do but at any rate, that's their standard. From what I've seen JOELib seems to be focused on representing specific, rather than generic (i.e. query), molecules so it seems as though the sd writer should put out alternating 1's and 2's. Or perhaps it's sensible to have behavior depend on a flag, so you can ask the sd writer to use type "4" bonds if desired. Here's a fragment of code that I think will do the trick. Let me know what you think. Wayne //check, if aromatic bond if (atom.isAromatic() && nbr.isAromatic() || (bond.getBO() =3D=3D JOEBond.JOE_AROMATIC_BOND_ORDER)) { // Non-query structures must use Kekule representation if (bondPairs.containsKey(new Integer(atom.getIdx())) || bondPairs.containsKey(new Integer(nbr.getIdx())))=20 { bondType =3D 1; // single bond } else { bondType =3D 2; // double bond bondPairs.put(new Integer(atom.getIdx()), new Integer(nbr.getIdx())); bondPairs.put(new Integer(nbr.getIdx()), new Integer(atom.getIdx())); } } else { // 1 single // 2 double bondType =3D bond.getBO(); } -------------------------------------------------------------------------= -------------------------------------------- This email may contain material that is confidential and privileged and = is for the sole use of the intended recipient. Any review, reliance or = distribution by others or forwarding without express permission is = strictly prohibited. If you are not the intended recipient, please = contact the sender and delete all copies. |