Chimera Tutorials Index

Image Tutorial: B-Factor Coloring

The recipe here is just one possibility; there are usually several ways to get the same or similar results. See also: presets, tips on preparing images

Start Chimera and show the Command Line (for example, with Favorites... Command Line). Fetch Protein Data Bank entry 2gbp:

Command: open 2gbp
Use the “all atoms” preset and delete the water:
Command: preset apply int 2
Command: delete solvent
Resize the window as desired, either by dragging its lower right corner with the mouse or by using the command windowsize. The window dimensions define the aspect ratio (width:height) of output images, but image resolution (pixel dimensions) can be specified independently when an image is saved.

The example image was saved with pixel dimensions 573 x 443 from a window of that same size:

Command: windowsize 573 443
Move and scale the structure using the mouse and the Side View as you wish throughout the tutorial.

Coloring by B-Factor

Start Render by Attribute (under Tools... Depiction) and make sure it is set to show the attributes of atoms. Look in the Attribute list to see what is available: bfactor and occupancy, which were read from the input PDB file. Choose bfactor; a histogram of the values will appear, with blue, white and red vertical bars (or thresholds).

You can control how colors will map to B-factor values by dragging the thresholds along the histogram and/or changing their colors. The Value and Color are shown for the most recently clicked or moved threshold. The Value changes when the threshold is moved, or the position can be changed by entering a value and pressing return. The Color can be changed by clicking the square color well and using the Color Editor. The slider positions in the editor can be adjusted, or a color name simply entered in the Color name field.

To make the example image, a blue threshold at value 2, a red threshold at 30, and a yellow threshold at 50 were used. Clicking Apply shows the currently defined color scheme on the structure. Once you have the desired coloring, click Create corresponding color key, but then just Close both the Color Key and Render by Attribute dialogs. Although the color key has now been set up to match the coloring scheme, we will not draw it in the Chimera window until later.

Alternatively, instead of the graphical interface, a command could have been used to perform the coloring:

Command: rangecolor bfactor key 2 blue 30 red 50 yellow
The key keyword sets up the Color Key dialog; as above, just close that dialog for now. While the command approach is more concise, the Render by Attribute graphical interface is friendlier in that it does not require previous knowledge of the attribute names, and it provides visual (histogram) information on the value distribution.

The coloring can be limited to certain representations, but in this example, both the atoms and the molecular surface (not yet shown) have been colored by bfactor value.

Clipping the Surface

Display the molecular surface:

Command: surf
Start Per-Model Clipping (under Tools... Depiction). In that dialog, set Model to the surface (not 2gbp itself, which contains the atoms) and turn on Enable clipping. Now part of the surface but not the atoms should be chopped away. The planar “cap” is not yet colored by B-factor; that will have to be done in a separate step. Keep the clipping dialog open.

Hide all atoms except for the ligand, glucose:

Command: show ligand
Next, adjust the clipping of the surface to the desired angle and position relative to the structure. In the Per-Model Clipping dialog, turn on Adjust clipping with mouse as below and use the specified mouse buttons to translate and rotate the clipping plane. A transparent green disk will be shown while you are making these adjustments. The mouse button assignments can be changed if you prefer. To return the mouse buttons to their normal functions, turn off Adjust clipping with mouse as below. It may be necessary to turn it on and off a few times to position the clipping plane to your satisfaction. Once that has been done, either turn off Adjust clipping with mouse as below or just Close the clipping dialog to return the mouse buttons to their normal functions.

The atoms were colored by bfactor value in the previous section. Select protein atoms and use Color Zone to make the planar cap match these atoms:

Command: select protein
Command: start Color Zone
This tool is also under Tools... Depiction in the menu. It is important to select only the intended atoms so as to avoid coloring the surface by other nearby atoms such as water and ions, which may be undisplayed and easy to forget. Click the Color button and increase the Coloring radius as needed to to color the whole cap. A radius of ~3-4 Å should suffice. Although the only part of the surface that needed coloring was the cap, Color Zone applies to the whole surface. Whereas Render by Attribute (and most other per-atom coloring of molecular surfaces) uses surface-to-atom associations from the molecular surface calculation, Color Zone (which works on both nonmolecular and molecular surfaces) simply associates a surface point with the closest atom center, and may thus change the coloring slightly from the Render by Attribute result.

Close the Color Zone tool and clear the selection:

Command: ~select

The color patches on the planar cap look somewhat fuzzy because of coarse surface triangulation. Start Surface Capping:

Command: start Surface Capping
and change the Mesh subdivision factor to 3 to make the triangles smaller and the color patches on the cap more distinct. Close that tool.

Finishing Touches, Labels, Color Key

Use a publication preset to make the background white, turn on black silhouettes, and generate a smoother molecular surface:

Command: preset apply pub 1
This preset also turns off depth-cueing (fog).

Place and orient the structure for the final image, leaving room for the title and color key. If you want to, save the position:

Command: savepos p1
Then if you accidentally move the structure later, the position can be restored with:
Command: reset p1
If you decide a later position is better, you can save it to a new name, or the same name to overwrite the previously saved position:
Command: savepos p1
Open the Color Key dialog (under Tools... Utilities). In that dialog, set the Label color to black by clicking the color well and using the Color Editor. The appropriate Font size depends on the window size; 26 was used with a 573 x 443 window.

Make sure that Use mouse for key placement is turned on and then click-drag in the main window to draw the key. It may take a few tries; click-drag to start over, or click on the middle of the key to drag it around. To rotate the structure instead (and/or to prevent erasing the existing color key), turn off Use mouse for key placement. After drawing the key to your satisfaction:

To add additional text to the image, click the tab to go to the Labels (2D Labels) section of the same dialog. Set the Color to black, then click in the graphics window to start a label and type to enter its contents. Each label can be repositioned by dragging and its font size can be edited to a different value. What font sizes are appropriate depends on the window size; use what you think looks best. The example image was created using window size 573 x 443, font size 30 for the main title, and font size 28 for the text above the color key. The Å symbol and superscript ² can be included by using the Insert symbol menu. Alternatively, symbols can be copied from text displays (such as a symbols page or even the preceding sentence!) and pasted into the Text area of the 2D Labels dialog. Close the dialog as soon as the labels are done, to allow rotating the structure and to avoid accidentally creating more labels.

Saving Your Work

Saving a session (see the File menu) right before or after saving the image is recommended if you might need to regenerate the same or a similar figure later, say at a different resolution or with modified coloring.

The image was saved at the same size as the window (573 x 443 pixels) using File... Save Image with default settings.


meng-at-cgl.ucsf.edu / February 2014