From: Wayne V. <vol...@re...> - 2003-12-15 20:39:33
|
bondPairs is a HashMap. The intent is to make sure that an aromatic atom is involved in at most one double-bond. If an atom has not participated in a double-bond and an aromatic atom it is attached to also has not participated in a double-bond, then bondType is set to 2. Both atoms are then added to the bondPairs HashMap, with the target of one atom's HashMap pointing to the other atom. If what I wrote it correct at all, though, it could just be a java.util.HashSet I guess. Doesn't need to be a HashMap. > -----Original Message----- > From: Joerg K. Wegner [mailto:we...@in...] > Sent: Monday, December 15, 2003 8:12 AM > To: Wayne Volkmuth > Cc: Joe...@li... > Subject: Re: [Joelib-help] aromaticity in SD files >=20 > Hi Wayne, >=20 > what contains the 'bondPairs'-variable ? Seems to be a HashMap or > something related, but what's their content. >=20 > Regards, Joerg >=20 > > 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 > >>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 > >>great chemical expert system behind 'simple' file conversion. Only if > >>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()))) > > { > > 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. > > > > > > > > ------------------------------------------------------- > > This SF.net email is sponsored by: IBM Linux Tutorials. > > Become an expert in LINUX or just sharpen your skills. Sign up for > IBM's > > Free Linux Tutorials. Learn everything from the bash shell to sys > admin. > > Click now! http://ads.osdn.com/?ad_id=1278&alloc_id371&op=3Dclick > > _______________________________________________ > > Joelib-help mailing list > > Joe...@li... > > https://lists.sourceforge.net/lists/listinfo/joelib-help > > >=20 >=20 > -- > Dipl. Chem. Joerg K. Wegner > Center of Bioinformatics Tuebingen (ZBIT) > Department of Computer Architecture > Univ. Tuebingen, Sand 1, D-72076 Tuebingen, Germany > Phone: (+49/0) 7071 29 78970 > Fax: (+49/0) 7071 29 5091 > E-Mail: mailto:we...@in... > WWW: http://www-ra.informatik.uni-tuebingen.de > -- > Never mistake motion for action. > E. Hemingway >=20 -------------------------------------------------------------------------= -------------------------------------------- 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. |