physiology

Third-party VMD plugins in a central location

Many people have troubles installing the VMD plugins in this website. To help with this issue I have put together a small guide with instruction on how to install third party VMD plugins. This method:

Directory structure

To make all this work, we need to create a plugins directory, which will hold all the third party plugins, each in its own subdirectory. This is the directory structure we are looking for, in this case with three plugins:

vmdplugins
|-- rmsdtt
|   |-- rmsdtt.tcl
|   `-- pkgIndex.tcl
|-- itrajcomp
|   |-- itrajcomp.tcl
|   |-- gui.tcl
|   :
|   :
|   `-- pkgIndex.tcl
|-- clustering
|   |-- clustering.tcl
|   `-- pkgIndex.tcl
`-- swap
    |-- swap.tcl
    `-- pkgIndex.tcl

Now, go ahead and create the main directory to hold your plugins. I suggest you use something like $HOME/vmdplugins for Linux and Mac, while for Windows I suggest C:\vmdplugins. Anything will do, just keep in mind that the following instructions will use those directories.

VMD start-up file

Now we need to let VMD know of this location. To do so, edit your VMD start-up file add the main plugins directory to the auto_path variable:

  • For Linux and Mac add the following to $HOME/.vmdrc:
    set auto_path [linsert $auto_path 0 [file join $env(HOME) vmdplugins]]
  • For Windows add the following to %USERPROFILE%/vmd.rc (%USERPROFILE%, at least in Windows XP, is C:\Documents and Settings\User; you can also just use %USERPROFILE% in Windows Explorer):
    set auto_path [linsert $auto_path 0 {C:\vmdplugins}]

With this command we are prepending our plugins directory to any other path that VMD will find. This is useful if you want to use your own modified version of a plugin that is also in the VMD installation.

Note: The previous commands have been tested with VMD 1.8.4 and up.

If you don't have a VMD start-up file, just create one. In this case I suggest that you also add the following to get your main VMD menu back:

main menu on

Third-party plugins

For each new plugin you should do the following:

  1. Extract the plugin to its own subdirectory in your plugins directory (see directory structure above). How to do this is going to depend on how the plugin is distributed. Most times you'll get a zip or tar.gz file.
  2. Add a menu entry for the new plugin. This menus will appear in the Extensions menu in the VMD main window. It might be a good idea to group all your third party plugins in its own submenu, ie. My Plugins. To do this, add the following to your VMD start-up file (example with the RMSDTT plugin):
    vmd_install_extension rmsdtt rmsdtt_tk_cb "My Plugins/RMSDTT"

    The first parameter is the name of the package, in this case rmsdtt. The second parameter (rmsdtt_tk_cb) is the name of the callback function that gets called when the plugin is started from the menu. There seems to be a convention to name this callback functions like the one in our example, but this is not a guarantee. You should contact the author of the plugin if you don't know the name of this function. The third parameter is the name of the menu under the Extensions menu. You can create submenus by using a forward slash (/) as separator.

VMD start-up file example

This is a complete VMD start-up file example for the rmsdtt, itrajcomp and clustering plugins:

# Bring main menu back
menu main on

# Prepend the path to third party plugins
set auto_path [linsert $auto_path 0 [file join $env(HOME) vmdplugins]]

# Add third party plugins
vmd_install_extension rmsdtt rmsdtt_tk_cb "WMC PhysBio/RMSDTT"
vmd_install_extension itrajcomp itrajcomp_tk_cb "WMC PhysBio/iTrajComp"
vmd_install_extension clustering clustering "WMC PhysBio/Clustering"