The Colvars Dashboard is a graphical interface for interactive visualization and refinement of collective variables aided by molecular structures and trajectories. It is accessible in VMD’s Main Menu under “Extensions/Analysis/Colvars Dashboard”. Throughout the interface, keyboard shortcuts for common operations are indicated in square brackets. Context menus in the colvar and bias tables can be accessed using either right click or Control-click.
Here are the steps for a quick first tour of the Dashboard:
load an MD trajectory into VMD;
open the Dashboard;
click “New” to create a new collective variable;
in the Editor window, click “Apply” to accept the default template;
in the Dashboard window, click “Show atoms” to display the two atom groups involved in this distance coordinate;
click “Timeline plot”;
click anywhere in the timeline plot to navigate in the trajectory.
Alternately, use the Automatic colvars features in the Actions tab.
Now, clicking “Edit” in the Dashboard window (or right-clicking on a colvar in the list view), you can modify the collective variable to reflect interesting geometric properties of the system. The power of the collective variables approach lies in the variety of geometric functions (“components”) and their combinations. The editor window provides a number of helpers to make it easy and quick to define the most relevant variables. See section 3.5 for details.
The Dashboard window displays a table listing currently defined variables, and their values for the current frame indicated at the bottom of the window. By default the frame is updated to track VMD’s currently displayed frame, but that can be changed by toggling the “Track frame” checkbox, e.g. to animate the trajectory without recomputing expensive variables. Vector-values variables can be expanded to list their scalar elements. This is necessary when individual scalar quantities have to be selected for plotting. Other operations act on variables as a whole and ignore specific selected scalar elements. Right-clicking in the table brings up a context menu with specific actions for the selected variables.
Buttons above the table allow for general operations on the state of the Colvars module. Below the table, the Actions tab allows operations on selected variables, while the Settings tab offers advanced settings for the various visualizations.
If variables are modified, added or deleted by an external script, hit “Refresh” or press F5 to update the displayed variables and values. Starting the Dashboard also enables trajectory animation using the left/right arrow keys within VMD’s graphical window. Atomic coordinates can be modified using VMD’s “Mouse/Move” functions, and the Colvars module can then be updated by pressing F5 directly from the graphical window.
A dropdown list allows for changing the current unit system if no variables are defined (see section 4.1). When changing units, it is strongly recommended to check the configuration for all colvars to ensure that all quantities are expressed in the desired set of units.
The Colvars Module interacts with one VMD Molecule at a time. At the bottom of the Actions tab, a dropdown lets the user change which VMD molecule is associated with the Colvars module. Internally, changing it means recording the configuration of currently defined colvars, deleting the current instance of the Colvars module, creating a new one linked to the target molecule, and applying the saved configuration. Beware of incompatible colvar definitions, such as atom groups listing atom IDs that exist in one molecule, but not the other. Auto-updating selections (see below) can be used to adapt the colvar definitions to a different system using VMD selection texts.
This saves the current configuration of the colvars Module to a file. This includes comments found in the input, general parameters of the Colvars Module, the collective variables themselves, and collective variable biases. The resulting configuration file can be read by Colvars, either back in VMD, or within a supported MD engine.
The Actions tab offers two buttons to generate sets of colvars from the current VMD session:
"protein auto-colvars" creates variables describing classic quantities used to describe protein structures;
"colvars from VMD labels" creates variables based on visible labels (Bonds, Angles, Dihedrals) for the current molecule (see Molecule selector in the same tab). Such labels can be created by setting the label mode with the key 2, 3, or 4, and picking atoms with the mouse.
These automatically generated colvars can be used as-is, or customized using the configuration editor (Edit in the context menu, or in the Actions tab).
The configuration editor can be started with the “Edit” or “New” buttons. Using the “Edit” button, the configuration of selected variables is loaded, and those variables will be replaced when applying the new configuration.
The editor window offers links to online documentation, as well as helpers to write correct configuration files.
As a first step, the most useful helper is the collection of template files. Some parameters that must be supplied are indicated by the symbol @. Colvar templates can be inserted at the beginning of the configuration, whereas “component” templates define basis functions that belong inside a colvar block. Templates are indented using 4 spaces per level to indicate their position in the nested structure of the configuration: general options, colvars and biases at level 0, bias and colvar parameters like components at level 1, component parameters such as atom groups at level 2, and atom group parameters at level 3.
The next helper buttons allow importing atom selections from VMD, either typing a VMD atom selection text, by copying the selection of an existing graphical representation, or by inserting the list of atoms currently labeled in VMD using the “Pick atom” feature. Atom selections should be inserted within an atom group block, within a component block (such as distance). By default atom selections are preceded with a comment line marking them as auto-updating. This instructs the Dashboard to update the list of atoms whenever the configuration is applied, that is, when it is edited, when the file is loaded by the Dashboard, or when changing the VMD molecule linked to Colvars. This is useful when working across systems with different atom numberings, but topologies that make the relevant atom groups identifiable using VMD selection texts. Special fields (O, B, and user) may be used, as well as atom positions (e.g. z > 0). If the selection text is modified manually, the atom list will be updated when applying the new configuration. This auto-updating behavior can be disabled by removing the special comment line or altering the keywords “auto-updating selection”.
Note that atom lists are not auto-updated:
when changing frame within the same molecule (animating a trajectory);
when the configuration is read by the Colvars module outside of VMD (eg. within an MD engine).
The “Insert labeled…” button combined with the selection box allows for inserting components matching VMD’s geometry measurements: Bonds (distances), angles, and dihedrals. Hidden labels are not used for inserting components.
show the selected variables as a function of time. A vertical bar indicates the current frame, which can be changed either using VMD’s trajectory animation controls, or directly in the plot window by clicking the mouse inside the graph, or using the keyboard left/right arrows. Shift+arrow steps by 10 frames for faster animation, and Ctrl+arrow steps over 50 frames. The Home/End keys jump to the first and last frames, respectively. The up/down arrows operate a zoom/unzoom along the time axis. Visible data can be fitted vertically using the h key. All data can be fitted horizontally using the h key.
are useful to identify correlation between variables. To create a pairwise plot, select exactly two scalar variables (or scalar components of vector variables), and click “Pairwise plot”. Frames are represented by circles, and lines connect consecutive frames. The blue dot tracks the current frame: clicking a circle jumps to the corresponding frame. Arrow keys and Home/End animate the trajectory as in the timeline plot.
displays a histogram of the selected scalar variable over the trajectory, using approximately the number of bins specified in the Settings tab (adjusted after selecting a round number for the bin width). The current value of the colvar is indicated by a vertical bar. Clicking anywhere in the plot jumps to the frame with the nearest value of the colvar. Keyboard navigation of the trajectory is similar to the other plots, except that the trajectory is traversed according to colvar values rather than frame numbers. This enables exploration of frames corresponding to a neighborhood of colvar values, even when they are not contiguous in time.
“Show atoms” creates representations of the atoms involved in the definition of the selected colvars. Each atom group is shown in a different color. “Show gradient” is available for scalar variables only. It creates a graphical representation of the atomic gradients of the selected variables, visualizing how the value of the collective variable would vary in response to a change in atomic coordinates. The graphical representation of the gradients is controlled by parameters in the Settings tab. Vectors representing the gradient are rescaled as indicated by the radio buttons Max. vector norm and Scaling factor. Max. vector norm rescales gradients so that the largest vector component of each colvar’s gradient is represented by an arrow of the specified length, in Å. Scaling factor rescales gradients by the specified factor, divided by the colvar’s width parameter (1 by default, see 5.21). This use of width makes it easier to compare the gradients of collective variables that are not commensurate. The scaling factor has the unit , where is the current length unit, and represents the natural unit of the collective variable. By default is unity, but may be seen as dimensionless if is expressed in cv units.
The Dashboard offers visualizations for specific types of variables:
Variables that represent rotation operations (as unit quaternions), such as those based on an orientation component, can be displayed by right-clicking on them in the colvar table. This creates a representation of the rotation as an arrow representing its axis, and two arms separated by the angle of the rotation, between 0 and 180 degrees.
For variables that are computed based on volumetric maps, representations of the related maps can be created using the "Show volmap" button, or again through a specific entry in the context menu available via right-click.
Parameters for fine-tuning these visualizations can be set in the Settings tab.
The main Dashboard window features a "Biases" tab that contains a list of currently defined biases, their current energy, and the colvars that they depend upon. A new harmonic bias acting on a given set of colvars can be created by selecting the colvars and opening the context menu in the colvar table (right click or control-click). A button enables creating a Timeline plot with the energies of currently selected biases, similar to the colvar Timeline plot. Only one plot can be active at a time. Another button creates a visualization of the biasing forces computed by the selected biases, similar to the gradient display for colvars. The graphical representation of forces is controlled by the same parameters as the gradients, shown in the Settings tab. The difference is the scaling factor unit, which is Ångström per Colvars force unit (that is, Ångström times Colvars length unit per Colvars energy unit).
Note that the energy of history-dependent biases such as ABF or metadynamics may not be updated in VMD. However, values of the bias energy from a previous simulation can be displayed if a state file has been loaded with cv load (section 4.2), or in the case of ABF, if inputPrefix was specified.
Hitting the Save button will save the configuration of any bias listed in this tab, except the harmonic wall biases that are created automatically from a colvar for which the lower or upper wall options are specified.
Sometimes, important time-dependent quantities are available for a trajectory, but must be computed by an external tool (e.g. energies from a simulation). These can be visualized alongside colvars by taking advantage of the scripted colvar feature.
Such a custom variable can either be computed on the fly (by calling an external tool or a VMD feature) or pre-computed and cached. For example, we can use VMD to compute the protein solvent-accessible surface area (SASA) on the fly:
set sasa_sel [atomselect top "protein and noh"]
proc calc_user_colvar { x } {
# Follow current Colvars frame
$::sasa_sel frame [cv frame]
return [measure sasa 1 $::sasa_sel]
}
The Tcl script above should be entered into VMD’s text console, or sourced from a file. Then we can define a colvar that will be calculated by the scripted procedure above, by entering the following configuration as a new colvar in the Dashboad Editor Window:
colvar {
name user
scriptedFunction user_colvar
distance {
# The distance component is just a placeholder
group1 {
dummyatom (0, 0, 0)
}
group2 {
dummyatom (0, 0, 0)
}
}
}
If the SASA computation is slow, it can be cached to make subsequent interaction responsive. To that effect, we source the following script to pre-compute the SASA for every frame and store it in VMD’s User field for atom 0.
set atom0_sel [atomselect top "index 0"]
for {set f 0} {$f < [molinfo top get numframes]} {incr f} {
$::sasa_sel frame $f
$::atom0_sel frame $f
$::atom0_sel set user [measure sasa 1 $::sasa_sel]
}
Then we use the following Tcl procedure to compute a custom variable that is simply equal to the User field for atom 0 for the current frame:
proc calc_user_colvar { x } {
# Follow current Colvars frame
$::atom0_sel frame [cv frame]
return [$::atom0_sel get user]
}
This version results in extremely fast updates.