# How to get Jmol to automatically determine and display bond order?

Some molecule file formats do not detail bond order and when I open these formats in Jmol implied (by the valency, of course) double bonds are not shown as double bonds but rather as single bonds. Is there a way to correct this behaviour? I tried to answer this question myself with a "calculate bond order jmol" DuckDuckGo search. It returned:

as the top three results. Not a single one mentioned something relevant. 3 seemed most relevant but it seems to talk about how to specify bond orders manually, not getting Jmol to automatically calculate them.

Bond lengths are shown in this screenshot:

The file opened is http://crystallography.net/cod/2236556.cif which is tianeptine hydrochloride.

• I don't know if your problem is that Jmol incorrectly assigns a single bond or if it does take some (wrong) information from the input file. Could you try to use "set autoBond" to force Jmol to calculate bond orders? ( wiki.jmol.org/index.php/Jmol_as_editor ) – DSVA Jul 16 '17 at 8:57
• Tried that, it was mentioned in 1. Did not do what I was looking for. – BH2017 Jul 16 '17 at 15:59
• Can you measure the bond lengths of the bonds with the wrong assignment? Jmol uses bond lengths for automatic assignment so I suspect that the limits for each type are set differently from what you expect, we should see that if we look at the lengths. That way we should be able to figure out where the problem is. Is it also possible for you to post/link such an example? – DSVA Jul 16 '17 at 16:06
• Added some with the wrong assignment to my question. – BH2017 Jul 16 '17 at 16:26
• You should be aware that you are not calculating a bond order in any case. You are assigning a single, double, triple rod to some (basically arbitrarily) chosen bond lengths. It is trying to force a Lewis-type structure onto a 3D model. It's tempting, and very suggesting, and experimentalists like this very much, but there is little to no justification to do that. Bond orders are not discrete; they are not natural numbers! – Martin - マーチン Sep 15 '17 at 3:49

The current definition of the *.cif file does not care about bond order, rather than indicating connectivity of atoms within a molecule. This is why representing organometallic complexes (like ferrocenes) drawn in sight of what is important for a crystallographer may differ from the one drawn by an organo(metallic) chemist. Among other data, *.cif include the position of the (hopefully correctly assigned) atoms, but nothing about hybridization ($sp^3$, $sp^2$, ...) -- which is one reason why you offer a drawing of the molecular structure of your product to your crystallographer when it comes to characterization by single crystal diffraction or powder diffraction analysis. In the style of a the ball-and-stick representation, the above drawing is correct.

It is however possible to request Jmol to discriminate between single, double, triple bonds. One approach to solve such a question is based on tables which relate typical bond lengths to single, double, triple bonds. To document this, I used the data set indicated by you, as well as Jmol (version 14.13.1, 2017-04-09) under Xubuntu 16.04 LTS with openjdk version "1.8.0_131". As far as I know, one has to proceed manually, individually for each bond in question.

As a preparation, be sure that Jmol may calculate the bonds, the corresponding menu is accessible via edit -> preferences:

If the option previously was disabled, restart Jmol now. Subsequently, open your *.cif file and activate the model kit module

which will enable a little drop-down menu on the left hand side, marked by the ribbon in magenta. For now you do not need to access the options there, but hover the mouse over the first, subsequently over the second atom along the bond you are interested. You will see that first the first atom, then the second atom is encircled. If you now return hovering from the second atom in question to a position between the two atoms in question (and still on top of the bond in question), and left-click, the bond order may be recalculated, and its display will change if deemed suitable -- as shown in the example of the oxygen atoms of the sulfonamide.

This takes some practice, and frankly, the operator needs to stay vigilant. In the case of aromatic cycles, the model kit module may correctly recognize the $sp^2$ character of the carbon atoms, but on the expense of hydrogen atoms attached to it. Hence a result like the following may be expected, where I intentionally halted to "re-assign" the bond order on the last two carbon atoms of this cycle:

Be aware that if you left-click on one of the atoms in question, you may alter its designated element. In the following, I did so while tapping on the carbonyl oxygen of the acid residue:

In such an instance, you should access the pull down menu of the model kit, and re-assign the atom type. Aberrant hydrogen atoms will be removed by this automatically, too:

• The compute bonds option, for me (on Arch Linux), was set to automatically by default so didn't need to change it. Secondly this isn't really automatic is it? I have to manually select each bond and change it myself. – BH2017 Jul 16 '17 at 19:00
• @BH2017 I will not exclude that there is a script option (as Jmol, similar to pymol, offers both GUI and CLI) to automate this. In sight of "just display double bonds as such", you may load more than one cell in Jmol (type in the CLI |load "foo.cif" {1 2 1}|), write a pdb (|write "foo.pdb"|, the commands are within the pipes) and proceed further in Avogadro (e.g. the elder branch, version 1.1.2) in ball-stick modus. For your test data, it works just fine (carbonyl / sulfonamide C=O, alternating C=C/C-C in the arenes). – Buttonwood Jul 17 '17 at 20:51

As Buttonwood stated, CIF is not the file format you would expect to preserve bond order within, and Jmol wiki suggests using other formats for that: MOL, MOL2, PDB, CML. I would like to propose a method involving a third-party tool that works out for me.

1. Open CIF in Olex2 (free, available on Win, MacOS, Linux).

2. Run compaq -c to assemble all atoms together with the largest molecular fragment; then grow and grow -w (not necessary for this structure, but is obligatory for those with an inversion center when molecular residues are split about special positions).

3. Due to the limitation of bond type that can be displayed in Jmol, we need to get rid of dotted bonds showing short interactions with deltai 0.

4. Run chemdraw to automatically assign bond orders.

5. Export CIF to MOL by running file 2236556.mol. MOL file is saved in the same directory where the CIF file is.

6. Open 2236556.mol in Jmol. All bond orders are preserved.

• Booo! Double bonds from (tetrahedral) sulfur to oxygen! (This is not criticising your answer, just the general practice of using such display styles.) – Martin - マーチン Sep 15 '17 at 3:34
• @Martin-マーチン I'm desperately trying to understand what is wrong with this. How the $\ce{[=S(O)O]}$ fragment should be shown then? – andselisk Sep 15 '17 at 3:40
• More correct would be single bonds; the octett expansion is basically obsolete, meaning: there are no d-orbitals involved. – Martin - マーチン Sep 15 '17 at 3:42
• @Martin-マーチン Ahaaa, I see. Thank you, I've never thought of that before taking it for granted (pretty much all crystallographic software I ever touched assigns double bonds there). Answering this question was educational for me too:) – andselisk Sep 15 '17 at 3:46