physiology

VMD plugins at WMC Physiology & Biophysics

Cluster: Clustering Tool

Description | Usage | Download | Installation | Author

Description

Cluster is a VMD plugin to visualize clusters of conformations of a structure. Each conformation is color coded according to the cluster to which it belongs. This is done by creating one representation for each cluster, and setting the Draw Multiple frames variable to the corresponding frame numbers.

Features include:

  • Import results from:
  • Color conformations by cluster.
  • Selection of clusters and/or conformations to display.
  • Multiple levels of clustering.
  • Custom representation.
  • Join single member clusters in a separate cluster.

Usage

To use the Cluster plugin you need:

  1. Load a trajectory of the conformations used for clustering into VMD.
  2. Define the atom selection and molecule to use as representation in vmd.
  3. Generate the clusters with one of the following external utilities and Import the results into the plugin:
    • NMRCLUSTER: import the "Cluster.log" file. Only a level (0) will be available. Outliers will be splitted in different clusters. Use the Join 1 member clusters to cluster them together.
    • Xcluster: import the ".clg" file. All levels of interest must be saved in order to display them in VMD (look in the Xcluster manual for the Writecls command).
    • R:
      1. Obtain the rmsd between structures. You can use the iTrajComp plugin for and easy way of doing this (I suggest writing the results in matrix format).
      2. Load the data into R and use one of the available functions in R to do hierarchical clustering (hclust, agnes, diana, ...). If you used the iTrajComp plugin to create the rmsd matrix, the following should work in R (see the documentation of the individual commands for further options):
                data = scan('/path/to/rmsd.mat')
                rmsd = matrix(data, nrow=sqrt(length(data)), ncol=sqrt(length(data)))
                library(cluster)
                cluster = agnes(rmsd, diss=T)
              
      3. Cut the tree into groups (levels) using cutree. You can cut into one or more groupings. For example
                levels = cutree(cluster, k=2:5)
              
        will output the cluster membership of each object for levels 2 to 5.
      4. Write the results to a file to input into the Cluster plugin:
                write.table(levels, file='levels.dat', quote=F)
              
      5. Import the file into the Cluster plugin.
    • Gromacs (g_cluster): import the "cluster.log" file. Only a level (0) will be available. g_cluster timesteps are automatically mapped into VMD frames. Thanks to Andrea Carotti for all his help with the testing.
  4. Managing the GUI:
    • Select the level you want to see. The list of clusters will be updated together with the colors of the conformations. All clusters will be displayed when you change the level.
    • Select/Deselect clusters to activate/deactivate them.
    • Select/Deselect conformations to activate/deactivate individual conformations.
    • All and None turn on/off all the clusters and conformations.
    • Activate Join 1 member clusters to display all single member clusters in a separate cluster (outl).
    • The atom selection to represent can be changed in the atom selection box. Click the Update Selection button to apply the changes.

Download

Send a mail to the author if you would like to be informed about new updates of this plugin.
1.7 (26 Feb'08) [download]
Change log:
  • Add support for cluster output from Gromacs utility g_cluster.
  • Fix colors when doing multiple imports.
  • Fix display of the 'outl' cluster.
1.6 (13 Aug'07) [download]
Change log:
  • Added support for cluster output from R.
  • 'Join 1 member' clusters works interactively (not just on import).
  • Upgraded number of colors to the vmd maximum.
1.5 (6 Apr'05) [download]
Note: Remember to change pkgIndex.tcl and the .vmdrc to reflect the change (see Installation notes).
Change log:
  • Namespace changed from CLUSTER to clustering. There was a clash with another plugin new in VMD 1.8.3.
1.4 (18 Jan'05) [download]
Change log:
  • Solved bug with colors when using more than 17 clusters.
  • Finished option to join cluster of 1 member together in cluster "outliers" (outl).
  • Selection of molecule recovered.
  • Parsing of Xcluster .clg file simplified.
  • Added button to change atom selection.
1.3 (18 Jan'05) [download]
Change log:
  • Added support for Xcluster:
    • Added new listbox with levels of clustering. Added another dimension to cluster.
  • Added Options frame with:
    • Atom selection for the representations.
    • Starting to add option to join cluster of 1 member together, although is not activated yet.
  • Minimized number of representations. Now each representation holds one cluster instead of one conformation.
1.2 (17 Aug'04) [download]
Initial version.

Installation

  1. Download the plugin from here to the directory where you store your VMD plugins.
  2. Add the following to your .vmdrc startup file (or create one) (for unix the path should be $HOME/.vmdrc, and for windows %USERPROFILE%\vmd.rc):
    1. For VMD 1.8.3 and up
      lappend auto_path {/path/to/your/plugins/directory}
      vmd_install_extension clustering clustering "WMC PhysBio/Cluster"
      
    2. For VMD 1.8.2 and down
      lappend auto_path {/path/to/your/plugins/directory}
      if { [catch "package require clustering" msg] } {
        puts "VMD Cluster package could not be loaded:\n$msg"
      } elseif { [catch {menu tk register "Cluster" clustering} msg] } {
        puts "VMD Cluster could not be started:\n$msg"
      }
      

    Remember to correct the path to your plugins directory; i.e, if you saved the plugin in /home/user/myplugins, write that same path in the auto_path line.

    Note: If you created the .vmdrc file, remember to add menu main on to get the main menu back.

  3. Start VMD. The Cluster plugin should be accessible from the Extensions menu.

Author

Send comments and feedback to Luis Gracia.

Luis Gracia | last updated: Tuesday, February 26 2008