Recent site activity

APBS‎ > ‎Examples‎ > ‎Visualization‎ > ‎

APBS electrostatics in VMD

The VMD molecular graphics software package provides support for both the execution of APBS and the visualization of the resulting electrostatic potentials. Documentation on the APBS interface has been provided by the VMD developers at We will supplement this with a basic demonstration of how go from a PDB entry to a plot of structure and potential in VMD using APBS.

Note: This tutorial was written using VMD 1.8.5.

Generating the PQR

We'll perform this example with arc repressor (PDB ID 1MYK), a DNA binding protein. The first step in the visualization process is generating a PQR file for use with VMD and APBS. Please follow the directions in the How do I get my structures ready for electrostatics calculations? section to generate a PQR file for this structure.

Loading the PQR

Load the PQR file you just created into VMD (File → New molecule... in the VMD Main window). Adjust the molecule to the desired view. Depending on the force field you used in PDB2PQR, you may notice that VMD is displaying some strange bonds. When a PQR file is loaded into VMD, bond distances are inferred from the PQR radii. These radii were chosen for continuum electrostatics calculations, not visualization, and therefore some of the radii are artificially small. Don't worry if some of the bonds appear a bit strange (hide the hydrogens if it really bothers you).

Running the electrostatics calculation

  1. Choose Extensions → Analysis → APBS electrostatics in the VMD Main window. A new APBS Tool window should appear.
  2. Choose Edit → Settings... in the APBS Tool window and set the path to your local copy of the APBS executable. Hit OK to close this window.
  3. Select the "0" calculation from the "Individual PB calculations (ELEC):" window. Hit the Edit button. Adjust the APBS settings here as you desire. The defaults are usually fine, although it may be useful to edit the ions to adjust the ionic strength used in the calculation. Hit OK when you're done.
  4. You're now ready to run the calculation. Hit Run APBS in the APBS Tool window. Check the VMD Console window for information about the job while it's running. When the job is finished, a "APBSRun: Load APBS Maps" window should appear. Select "Load files into top molecule" and hit OK.
You're now ready for electrostatics visualization.

Electrostatics visualization

Isocontour visualization

One popular visualization method is the isocontour.
  1. First, choose Graphics → Representations... from the VMD Main window.
  2. Hit the Create Rep button and change Drawing Method to "Isosurface".
  3. Change Draw from "Points" to "Solid Surface" and Material to "Transparent".
  4. Note that the current isovalue is 0; change this to 1 (or 5 or 10 or whatever) depending on your personal preferences.
  5. To continue the lonstanding tradition of electrostatic potential coloring, choose "ColorID 0" for the Coloring Method.
  6. For the negative isocontour, hit "Create Rep" and select the newly created representation. Change the isocontour value to -1 (or 5 or 10...) and the ColorID to 1.
At this point, you probably have an image that looks something like this (note that I changed the surface to points to make the figure a bit cleaner):

Visualizing surface potentials

Another popular method of electrostatic potential visualization maps the electrostatic potential to the biomolecular surface. Before proceeding, you may want to delete the two isocontours you just created using the Delete Rep in the Graphical Representations window.
  1. Go to the Graphical Representations window (Graphics → Representations... from the VMD Main window) and create a new representation of the molecule with the Create Rep button.
  2. Go to the "Draw style" tab of the Graphical Representations window and change Drawing Method to "Surf" and Coloring Method to "Volume".
  3. Go to the "Trajectory tab" of the Graphical Representations window and change the "Color Scale Data Range:" to -10 to 10 (or whatever your favorite values are).
  4. Based on your version of VMD and your personal preferences, you might want to change the color scale for this image. Go to Graphics → Colors... in the VMD Main window and select the "Color Scale" tab from the new "Color Controls" window. The traditional coloring scheme for electrostatics is "RWB" (in the Method menu).
Your molecule now probably looks like this:

For your information, VMD appears to generate a molecular or Connolly type of surface rather than the solvent-accessible or Lee-Richards surface I personally prefer for this type of visualization.... It is usually more useful to plot the surface potential on a more inflated surface than the molecular surface; for example, use an inflated van der Waals surface or the solvent-accessible surface. If you use the molecular (e.g. Connolly) surface, it is not far from just plotting positively- and negatively-charged residues.

Visualizing field lines

Field line visualization can be a very informative way to examine the local intensity of electric fields and related gradient quantities in the context of the biomolecular structure. For this example, we'll use the mouse acetylcholinesterase (mAChE; PDB ID 1MAH) since the field lines around this molecule are often used to interpret preferred mechanisms of binding for the positively-charged substrate.  The APBS distribution comes with a pre-processed PQR file for the mAChE structure available in the examples/misc/ directory of the distribution; this file can also be found attached below.

As in previous examples, we start by loading the mache.pqr file into VMD as a PQR file. Once this is loaded, go to the Graphics → Representations window and change the Drawing Method to NewCartoon or some other view that's a bit less cluttered. At this point, your VMD window might look something like this:

The APBS electrostatics calculation is performed essentially as described in the above examples. However, for field lines, it is generally useful to increase the calculation box dimensions before running APBS. After setting up the APBS calculation as described above, select the "0" calculation from the "Individual PB calculations (ELEC):" window. Press the Edit button and set
  • Coarse Grid to: 170 170 170
  • Center: 0 mache.pqr
  • Fine Grid to: 105 105 105
  • Center: -24.29 6.6 1.7
You should vary these settings for different problems or to further explore field lines for the mAChE system.
You're now ready to run the calculation. Press Run APBS in the APBS Tool window. Check the VMD Console window for information about the job while it's running. When the job is finished, a "APBSRun: Load APBS Maps" window should appear. Select "Load files into top molecule" and press OK.

We're now ready to visualize the electric field lines around mAChE:
  1. Choose Graphics → Representations from the VMD Main window and press the Create Rep button.
  2. Change Drawing Method to "FieldLines"
  3. The default parameters for field lines are reasonable but it might be useful to increase the size of the lines and change the density of these lines for easier visualization through the following settings:
    • Size: 2
    • GradientMag: 8.3
    • Min Length: 1.00
    • Max Length: 200.00
  4. We're now going to color the field lines by the electrostatic potential value:
  5. Set the Coloring Method to Volume.
  6. Navigate to the Trajectory tab and set the Color Scale Range from -0.5 to 0.5 (or to different values if you want to change the distribution of color along the field line).
  7. Press the Set button for the changes to take effect.
Your VMD window should now show the mAChE molecule with the electric field lines:

Nathan Baker,
Mar 5, 2010, 11:31 AM