Standard Data File Options
Write
write [invert] [noxcol] [groupby <type>] [noheader] [square2d|nosquare2d] [nosparse|sparse [cut <cutoff>]]
invert
Normally, data is written out with X-values pertaining to frames (i.e. data over all trajectories is printed in columns). This command flips that behavior so that X-values pertain to data sets (i.e. data over all trajectories is printed in rows).
groupby <type>
(1D) group data sets by <type>:
name
Group by name.
aspect
Group by aspect.
idx
Group by index.
ens
Group by ensemble number.
dim
Group by dimension.
xcol
Write indices for the specified datafile. This is usually the default behavior.
noxcol
Prevent printing of indices (i.e. the #Frame column in most datafiles) for the specified datafile. Useful e.g. if one would like a 2D plot such as phi vs psi. For example, given the input:
dihedral phi :1@C :2@N :2@CA :2@C out phipsi.dat dihedral psi :2@N :2@CA :2@C :3@N out phipsi.dat datafile phipsi.dat noxcol
CPPTRAJ will write a 2 column datafile containing only phi and psi, no frame numbers will be written.
header
Write header line at beginning of data file. This is usually the default behavior.
noheader
Prevent printing of header line (e.g. ’#Frame D1’) at the beginning of data file.
square2d
Write 2D data as a square matrix, e.g.:
<1,1> | <2,1> | <3,1> |
<1,2> | <2,2> | <3,2> |
nosquare2d
Write 2D data in 3 columns as: <X> <Y> <Value>
sparse
Only write 3D grid voxels with value > cutoff (default 0).
cut <cut>
Cutoff for ‘sparse’; default 0.
nosparse
Write all 3D voxels (default).
Read
read [prec {flt|dbl}] {[read1d [index <col>] [onlycols <range>] [floatcols <range>] [intcols <range>] [stringcols <range>]] | [read2d [{square2d|nosquare2d}]] | [vector] | [mat3x3] | [read3d [dims <nx>,<ny>,<nz>] [origin <ox>,<oy>,<oz>] [delta <dx>,<dy>,dz>] [prec {dbl|flt}] [bin {center|corner} ] }
prec {flt|dbl}
Read 2d/3d data as single (flt) or double (dbl, default) precision.
read1d
Read data as 1D data sets (default).
index <col>
Use column <col> (starting from 1) as index column (1D data only).
onlycols <range>
Only read columns in range.
floatcols <range>
Force specified columns to be read as single-precision floats.
intcols <range>
Force specified columns to be read as integers.
stringcols <range>
Force specified columns to be read as strings.
read2d
Read data as 2D matrix.
square2d
Read data as square matrix (default).
nosquare2d
Read data as XYZ matrix (i.e. each line contains ‘<column> <row> <data>’).
vector
Read data as vector. If indices are present they will be skipped. Assume first 3 columns after the index volumn are vector X, Y, and Z, and (if present) the next 3 columns contain vector origin X, Y, and Z.
mat3x3
Read data as 3×3 matrix. If indices are present they will be skipped. Assume matrices are in row major order on each line, i.e. M(1,1) M(1,2) …M(3,2) M(3,3).
read3d
Read data as 3D grid. If no dimension data in file must also speify ‘dims’.
dims <dx>,<dy>,<dz>
Grid dimensions.
origin <ox>,<oy>,<oz>
Grid origins (default 0,0,0).
delta <dx>,<dy>,dz>
Grid spacings (default 1,1,1).
prec {dbl | flt}
Grid precision, double or float (default float).
bin {center | corner}
Coords specify bin centers or corners (default corners).
By default, standard data les are assumed to contain 1D data in columns. Data set legends will be read in if the file has a header line (denoted by ‘#’). Columns labeled ‘#Frame’ are automatically considered the ‘index’ column and skipped. Data sets are stored as <name>:<idx>
where <name>
is the given data set name (the file name if not specified) and <idx>
corresponds to the column the data was read from starting from 1. CPPTRAJ assumes the data increases monotonically and will automatically attempt to determine the dimensions of the data set(s); a warning will be printed if this is not successful.
If a file contains the header: #F1 F2 <name>
CPPTRAJ will assume the file contains pairwise distances for clustering, where the F1 and F2 columns contain the frame numbers, and the <name>
column contains the distance.