Adding Labels to Jmol Scenes
This Jmol Training Guide was created with funding from NIH Grant #1 R25 RR022749-01 and NSF-DUE #1323414 and #1725940. Revised 8/2020.

This Jmol Exploration was created using the Jmol Exploration Webpage Creator from the MSOE Center for BioMolecular Modeling.

version 2.0
Exploration Content

This section of the Training Guide uses the protein Top 7 based on PDB file 1qys.pdb. Please see Getting Started with Jmol for information on how to download and open PDB files.

In this section, we'll use the select command to select specific atoms in your protein. Please see Selecting and Boolean Operators if you need more information about the select command in Jmol.

Adding Labels

You may wish to add labels to your Jmol image to use on a paper poster or in an e-poster.

First, choose what part of your protein you want to label. This can be a sidechain, a ligand, or even an entire domain of your protein!

Then select an atom number on or near what you want to label.

select atomno=290
select @290

Next, label that atom number.

label 'lysine'

Be sure to use quotes around your actual label.

Click the button below to see the lysine labeled.

label 'lysine'

The label is quite difficult to see in its current form because of its location, color, and size. Continue on to find out how to modify your label.

Changing the Location of the Label

To change the location of your label, use the set labeloffset command, followed by two numbers. These numbers are the degrees in which the label will be moved with respect to the atom number.

set labeloffset 50 5

The first number is degrees along the X axis. A positive number will move the label to the right along the X axis, whereas a negative number there will move the label to the left along the X axis.

The second number is degrees along the Y axis. A positive number here will move the label up along the Y axis, and a negative number will move the label down along the Y axis.

The command set labeloffset 0 0 will place the label DIRECTLY onto the atom you selected.

Click the button below to see the label moved 50 degrees on the X axis and 5 degrees on the Y axis.

set labeloffset 50 5

The command set labelfront will set your label in front of the atom you selected. You can see its effect when you try to rotate the protein: the label will always stay in front of the atom, instead of being blocked by the protein as you rotate it.

Compare how your label behaves between the previous button and the next button by rotating the protein. Here you can see the effect of the command.

set labelfront

Note: This command isn't necessary, but can be used for its aesthetic appeal.

To turn off set labelfront, use the command set labelfront off.

Note: For the rest of this tutorial, the command set labelfront will be used in each Jmol button so you can more easily see the label as you rotate the protein.

Changing the Color of the Label

You can also change the color of your label. Use the color label command and whatever color you would like to use.

color label blue

Click the button below to see the label change to blue.

color label blue

Changing the Size and Font of the Label

To change the size and font of the label, use the font label command. There are three variables you can manipulate in this command: the font size, the font, and the font modifier.

font label 30 serif bold

The first variable is the font size. This can range from 6 to 63.

The second variable is the font. In this case, the font serif was used. Your options for this are serif, sanserif, or monospaced.

The third variable is the font modifier. In this case, bold was used. Your options for this are bold, italic, or plain.

Click the button below to see the label change.

font label 30 serif bold

Here are some other examples of changing the size and font of the label.

font label 45 sanserif italic
font label 20 monospaced plain

Measuring Distances Between Atoms

In some applications, you may wish to measure (and display) the distance between two atoms in your model. For instance, you might wish to show that two atoms are close enough to each other to interact, say, by forming a hydrogen bond.

Measuring Distances

If you only want to measure the distance between two atoms, use the set picking distance command:

set picking distance

When you click on two atoms consecutively, information will be reported back in the Jmol console window:

Atom #1:[LEU]74:A.CD2 #534

Atom #2:[MSE]37:A.CE #260

Distance [LEU]74:A.CD2 #534 - [MSE]37:A.CE #260 :

The first two lines identify the two atoms that were selected, and the third line reports the distance between the center of the two atoms, in Ångströms, here approximately 3.38 Å.

Labeling Distances

If, on the other hand, you want the distance to appear on the Jmol screen, use the set picking measure command:

set picking measure

When you click on two atoms consecutively, information will be reported back in the Jmol console window and will appear on the Jmol screen:

Atom #1:[LEU]33:A.CD1 #232

Atom #2:[ILE]66:A.CG2 #472

Distance [LEU]33:A.CD1 #232 - [ILE]66:A.CG2 #472 :

0.338 nm

Although you won't see the feedback that is provided on the Jmol console, if you click the button below, then click on any two atoms in the Jmol window at the right, the distance between the atoms will be displayed.

set picking measure

If you accidentally click the wrong two atoms, and then want to remove the label, simply click the two atoms consecutively again, and the label will disappear.

If you click on the 'Set picking measure' button again, the image will reset and all the distance measures will disappear.

Displaying Distances in Jmol Animations

If you want to add a label to a Jmol Animation (online e-poster or tutorial), you'll have to use the measure command. In this example, I want the distance between atoms 34 and 362. The units for the measurement appear in nm.

set measurementnumbers on
measure (@34) (@362)

Measurements in Jmol Animations