General Analysis

Analysis Script Base

These scripts function as the base for the analysis framework using VMD. They provide the means to load and read files, loop over a set of trajectory files, center the system at each frame, etc. The specific analysis performed is specified in separate procedures which are called from the base scripts.

Script: analyze.tcl

Additional Files: analysisInp.tcl

Use: After modifying the analysisInp.tcl script for your specific analysis and trajectory, just execute the analyze.tcl file from VMD:

vmd -dispdev text -e analyze.tcl

Notes: The analyze.tcl script is the base script for analyses and does not change from analysis to analysis. By writing individual analysis specific scripts (see below), and using them with the base script, analyses can be performed.

The user should read through analyze.tcl to see what specifically is being done in the framework of the analysis, but in general, no modification to the file is needed. The user does need to edit analysisInp.tcl, by providing the names and location of the trajectory files, the information about the analysis, and how to handle the trajectory.




Miscellaneous Utilities

The analysis scripts given here use several general VMD/TCL procedure to do common things like centering configurations and reading xst files. These procedures are defined in the following script.

File: utils.tcl

Notes: As the VMD/TCL procedures provided in utils.tcl are generally useful, one could place the script in a special directory and source the file in the .vmdrc file so that the procedure as always available in VMD. To use the analysis scripts here, it is assumed that the VMD environment has sourced the script -- explicit "sourcing" of the utils.tcl script is not done in the files provided here.




Specific Analyses

The scripts below are the scripts which do the specific analysis calculations. They are used in conjunction with the analyze.tcl and analysisInp.tcl scripts described above. These scripts come in pairs: one script contains the analysis code and the other is the input file for the analysis which defines the analysis parameters.

The script containing the analysis code must define two procedures, the first giving the analysis code to be performed at each step, and the second providing the code performed after the trajectory files have been processed (i.e. do the normalization and write out the data). These procedures can be named anything, and must be given in the analysisInp.tcl file above.

The user can easily write new script to work with the analysis script base (analyze.tcl). Using the scripts provided below as examples, the user must first write an analysis procedure that will be called at each step. As the analyze.tcl script does the job of reading the files, centering the trajectory, reading the cell dimensions, etc., the user just needs to write the code to do the analysis. The user also needs to write a function which processes the final data and writes it out.

While the user needs to edit the analysis input files, in general, the analysis scripts themselves do not need to be edited. The analysis input files, along with the analyze.tcl and analysisInp.tcl files must go in the data processing directory, while the analysis scripts can go in a separate directory which is given in the analysisInp.tcl file.


Density Profiles

Files: density.tcl, densityInp.tcl

Notes: Calculates basic 1-D density profiles, along the z-axis. Using atomselections, the user can calculate many different density profiles at the same time. Density profiles are written out in units of atoms/Å3


Radial Distribution Functions

Files: radDist.tcl, radDistInp.tcl

Notes: Calculates radial distribution function. Using atomselections, the user can calculate many different RDFs at the same time. RDFs are calculated for surrounding atoms around reference atoms, given in the input file.


Charge Densities, Electric Fields and Electrostatic Potentials

Files: chargeDens.tcl, chargeDensInp.tcl

Notes: Calculates 1-D charge density, electric field and electrostatic potential along the z-axis. The file chargeDens.tcl can be edited to change where the zero of the potential is calculated. Produces symmeterized (about z=0) and non-symmeterized output.


Water Polarization Orientation Profiles (1-D)

Files: polOrient.tcl, polOrientInp.tcl

Notes: Calculates 1-D water polarization orientation plot along with z-axis, with respect to the z-axis. Output gives the cos of the angle between the H-H bisector and the z-axis as a function z, averaged over all of the water molecules.


Water Polarization Orientation Profiles (3-D)

Files: polOrient.tcl, polOrient3DInp.tcl

Notes: Calculates 3-D water polarization orientation plot with respect to the z-axis distance and cos(angle). Output gives a density map where each z-axis slice is normalized to 1. The output is written in the format readable by gnuplot: x_slow y_medium z_value


Group Mean and Standard Deviation

Files: meanStdev.tcl, meanStdevInp.tcl

Notes: Calculates the positional mean and standard deviation of groups of atoms as a function of time. Averages can be obtained by simply averaging the output time series (using AWK for example).




Copyright © 2007 Ryan W. Benz