Dear developers,
there is a bug in CifReader.java (trunk) stopping the bond orders from being read from _ccdc_geom_bond_type
tag (CIF files). Please find a patch pasted as output of 'svn diff' below:
Index: src/org/jmol/adapter/readers/cif/CifReader.java =================================================================== --- src/org/jmol/adapter/readers/cif/CifReader.java (revision 20961) +++ src/org/jmol/adapter/readers/cif/CifReader.java (working copy) @@ -1528,7 +1528,7 @@ String name1, name2 = null; while (parser.getData()) { if ((asc.getAtomIndex(name1 = getField(GEOM_BOND_ATOM_SITE_LABEL_1))) < 0 - || (asc.getAtomIndex(getField(GEOM_BOND_ATOM_SITE_LABEL_2))) < 0) + || (asc.getAtomIndex(name2 = getField(GEOM_BOND_ATOM_SITE_LABEL_2))) < 0) continue; float dx = 0; String sdist = getField(GEOM_BOND_DISTANCE);
Best,
Andrius
Thank you -- good catch! Note that this affects only CIF files having the _ccdc_geom_bond_type tag, as pointed out aready. This bug was introduced in Jmol 14.3.16_2015.08.11 (Aug 11, 2015). It will be corrected in the next update.
Thank you for the prompt reply and incorporation of the patch!
see http://chemapps.stolaf.edu/jmol/zip/jmol-14.4.2_2016.02.15.zip
However, this is not the full fix. All it does is make it so that IF _geom_bond.ccdc_geom_bond_type is present, then the distance information is processed. However, that is not the design. The design, unfortunately broken three years ago, was to allow the distance information to be read without that field, and to only use that field for setting multiple bonding. Right now I cannot find any files that actually have that flag. Do you have some examples? So I am working on considering the implications of fixing a three-year-old bug. The way it is supposed to work is that CIF files with _geom_bond blocks load by default as molecular structures, connected as specified and without unit cell showing.
I see. Particularly I am interested in reading the bonding details. Here are a few examples having both
_geom_bond_distance
and_ccdc_geom_bond_type
:http://www.crystallography.net/cod/7105873.cif@106525
http://www.crystallography.net/cod/7201224.cif@158825
http://www.crystallography.net/cod/7220737.cif@176428
Please let me know if you need some more. A more standard (IUCr recommended) way to define bonding in CIF files is via
_chemical_conn_bond_*
tags http://www.iucr.org/__data/iucr/cifdic_html/1/cif_core.dic/Cchemical_conn_bond.html. Examples are here:http://www.crystallography.net/cod/7213235.cif@176453
http://www.crystallography.net/cod/1519159.cif@135472
http://www.crystallography.net/cod/1519190.cif@135506
AFAIK, the main difficulty of implementing
_chemical_conn_bond_*
tags along_ccdc_geom_bond_type
would be to remove excess bonds made with symmetric equivalents.Last edit: Andrius Merkys 2016-02-18
fixed long ago