NMWiz Commands

NMWiz commands allow altering molecule coordinate and normal modes, as well as adding new modes. Commands can also be used to generate combinations of modes and add them to the dataset (see the example at the end). These commands would be entered in the Tk Console of VMD.

Following are the level commands:

  • nmwiz list - lists all normal mode dataset handles
  • nmwiz load - loads a dataset in NMD format
  • nmwiz main - shows NMWiz main window

Dataset handles

A handle of a dataset as follows:

set nmdhandle [nmwiz load p38_MAPK_1p38_anm.nmd]

Or you can use the list command to get a handle to the dataset at given index:

set nmdhandle [lindex [nmwiz list] 0]

This handle can provides the following commands:

  • $nmdhandle numatoms - get number of atoms
  • $nmdhandle getcoords - get molecule coordinates
  • $nmdhandle setcoords array - set molecule coordinates
  • $nmdhandle nummodes - get number of modes
  • $nmdhandle getmode index - get mode array
  • $nmdhandle setmode index array - set mode array
  • $nmdhandle getlen index - get length of mode
  • $nmdhandle setlen index length - set length of mode
  • $nmdhandle addmode array - add new mode

Combining modes

Two mode arrays can be combined linearly to generate a new mode as follows:

set nmdhandle [lindex [nmwiz list] end]
set m1 [$nmdhandle getmode 1]
set l1 [$nmdhandle getlen 1]
set m2 [$nmdhandle getmode 2]
set l2 [$nmdhandle getlen 2]
$nmdhandle addmode [vecadd [vecscale $l1 $m1] [vecscale $l2 $m2]]


Note that we used VMD vector subroutines for array operations. See VMD user guide for list of all vector and matrix subroutines which may be useful for manipulating normal mode arrays.

New mode will be available immediately in the NMWiz GUI and can be used in depictions and for animations.

Inverting a mode

Inverting a mode array and adding to the dataset is can be performed as follows:

set nmdhandle [lindex [nmwiz list] end]
set m1 [$nmdhandle getmode 1]
$nmdhandle setmode 1 [vecinvert $m1]

Changing coordinates

It is also possible to change the coordinates of the molecule. New or updated normal mode depictions will originate from the new coordinates. Below, we place all atoms of the molecule to the origin:

set nmdhandle [lindex [nmwiz list] end]
set zeros [vecscale 0 [$nmdhandle getcoords]]
$nmdhandle setcoords $zeros

In fact, NMWiz logo shown below was generated using this dataset with above change.


Slowest three ANM modes for p38 generated by setting molecule coordinates to zero.