
                      *** grms_to_central ***

This program reads the binary output of the GROMACS analysis tool g_rms (or
'gmx rms' in recent versions), which is produced with the option -bin, and
calculates the central structure as defined in ref. [1].  The central
structure is calculated even when the matrix is not symmetrical (comparison
of different trajectories) though this information might be useless.


----------------------------------------------------------------------------
Compilation:

Run 'make all' to compile executables for single and double precision.
Alternatively, run only 'make single' or 'make double', according to the
precision originally used when compiling your GROMACS version.


----------------------------------------------------------------------------
Usage:

grms_to_central <tel_mat> <tel_mat2> <input_bin> <run_name>

This reads the matrix given by <input_bin> of size <tel_mat>*<tel_mat2> and
writes it in <run_name>.xvg. The file <input_bin> is written by g_rms, with
option -bin, and compares a 1st trajectory of size <tel_mat> with a 2nd
trajectory of size <tel_mat2>. A file called <run_name>.var is also written
containing the dispersion measure defined in Eq. 1 of ref. [1] regarding
each index of the 1st trajectory. The index of the 1st trajectory
corresponding to the central structure (minimizing the dispersion measure,
ref. [1]) is written as standard output. The index count starts at zero.


----------------------------------------------------------------------------
Examples:

1) Symmetric matrix: tel_mat=tel_mat2 

traj.xtc has 300 frames.

/gromacs/gromacs-4.5.4/bin/g_rms  -f traj.xtc \
    -s traj.tpr \
    -o rmsd.xvg \
    -m rmsd.xpm \
    -bin rmsd.dat \
    -nomw &> junk <<EOF
4
4
EOF

grms_to_central 300 300 rmsd.dat crossrmsd
>100

The central structure is frame 101 (counting starting at one).
The matrix is written in crossrmsd.xvg.
All dispersion values in crossrmsd.var.


2) Non symmetric matrix: tel_mat!=tel_mat2 

traj1.xtc has 300 frames and traj2.xtc has 200.

/gromacs/gromacs-4.5.4/bin/g_rms  -f traj1.xtc \
    -f2 traj2.xtc \
    -s traj.tpr \
    -o rmsd.xvg \
    -m rmsd.xpm \
    -bin rmsd.dat \
    -nomw &> junk <<EOF
4
4
EOF

grms_to_central 300 200 rmsd.dat crossrmsd
>45

Frame 46 of file traj1.xtc minimizes the dispersion of traj2.xtc
relative to each frame in traj1.xtc.

----------------------------------------------------------------------------
Authors:

Sara R. R. Campos

----------------------------------------------------------------------------
Citation:

If you use this grms_to_central, please cite ref. [1].

----------------------------------------------------------------------------
Reference:

[1] Campos, S. R. R., Baptista, A. M. 2009 ''Conformational analysis in
a multidimensional energy landscape: study of an arginylglutamate
repeat'', J. Phys. Chem. B, 113, 15989. (http://dx.doi.org/10.1021/jp902991u)

----------------------------------------------------------------------------
