- Notifications
You must be signed in to change notification settings - Fork7
VMD plugin to calculate and visualize clusters of conformations for a trajectory
License
luisico/clustering
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Clustering is a VMD plugin to calculate and visualize clusters of conformations for a trajectory. 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 variableDraw Multiple frames to the corresponding frame numbers.
Website:http://physiology.med.cornell.edu/faculty/hweinstein/vmdplugins/clustering
Features include:
- Compute clusters using VMD's internalmeasure cluster command
- Import results fromR,Xcluster,Gromacs,Charmm,NMRCLUSTER
- Color conformations by cluster
- Selection of clusters and/or conformations to display
- Multiple levels of clustering
- Custom representations
- Join single member clusters in a separate cluster
A small guide on how to install third party VMD plugins can be foundhere. In summary:
- Create a VMD plugins' directory if you don't have one, ie/path/to/plugins/directory.
- Clone or download the project into a subdirectory of yourVMD plugins' directory (ie./path/to/plugins/directory/clustering):
cd /path/to/plugins/directorygit clone https://github.com/luisico/clustering.git clustering
- Add the following to your$HOME/.vmdrc file (if you followed the instructions in the link above, you might already have the first line present):
set auto_path [linsert$auto_path 0 {/path/to/plugins/directory}]vmd_install_extension clustering clustering"WMC PhysBio/Clustering"
The plugin should be accessible from theExtensions menu.
To use the Clustering plugin you need to:
- Load a trajectory of conformations used for clustering into VMD.
- Define theatom selection and molecule to use as representation in vmd.
- Generate the clusters with VMD's internal measure cluster command. More information aboutmeasure cluster can be found in VMD's manual. All options in Clustering'sUse measure cluster section correspond to the options available tomeasure cluster.
- Import results from a third party solution (see below)
- Viewing clusters:
- Select thelevel you want to see. The list of clusters will be updated together with colored conformations. All clusters will be displayed when you change the level.
- Select/Deselectclusters to activate/deactivate them.
- Select/Deselectconformations to activate/deactivate individual conformations.
- All andNone turn on/off all clusters and conformations.
- ActivateJoin 1 member clusters to display all single member clusters in a separate cluster (outl).
- Theatom selection to represent can be changed in the atom selection box. ClickUpdate Selection button to apply the changes.
Ref:R withhierarchical clustering
First obtain the rmsd between structures. You can useiTrajComp for an easy way of doing this (I suggest writing the results in matrix format).
Load the data into R and use one of the available functions in R to do hierarchical clustering (hclust,agnes,diana, ...). If you used theiTrajComp 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)
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.
Write results to a file to input into the Clustering plugin:
write.table(levels,file='levels.dat',quote=F)
Importlevels.dat into theClustering.
Ref:Xcluster
Import Xcluster's.clg output file intoClustering. All levels of interest must be saved in order to display them in VMD (look in Xcluster's manual for theWritecls command).
Ref:http://www.gromacs.orgg_cluster:http://manual.gromacs.org/online/g_cluster.html
Import the "cluster.log" file. Only a level (0) will be available. g_cluster timesteps are automatically mapped into VMD frames.
Ref:Charmm with theclustering command
Import theoutput membership file intoClustering.
Ref:http://neon.chem.le.ac.uk/nmrclust (link has been down for some time)
ImportCluster.log intoClustering. Only a level (0) will be available. Outliers will be splitted in different clusters. CheckJoin 1 member clusters to cluster them together.
A text file containing one line per frame, where then-th line contains one integer which is the index of the cluster containing then-th frame. Supports a single level.
Luis Gracia (https://github.com/luisico)
Developed at Weill Cornell Medical College
Please, use issues and pull requests for feedback and contributions to this project.
Thanks to Andrea Carotti for all his help with testing the Gromacs importer.
See LICENSE.
About
VMD plugin to calculate and visualize clusters of conformations for a trajectory