set
Set or update a script variable.
set { <variable> <OP> <value> |
<variable> <OP> {atoms|residues|molecules} inmask <mask>
[parm <name> | parmindex <#> | <#>]
<variable> <OP> trajinframes }
Available <OP> : ’=’, ’+=’
<variable> <OP> <value> Set or append a script variable.
<variable> <OP> {atoms|residues|molecules} inmask <mask> Set/append a script
variable to/by the total number of atoms/residues/molecules selected by
given mask expression.
parm <name> | parmindex <#> | <#> Topology to which mask should correspond
(default first).
<variable> <OP> trajinframes Set/append a script variable to/by the total number of
frames in trajectories currently loaded by trajin commands.
Set (<OP> = ’=’) or append (<OP> = ’+=’) a script variable. Script variables are character strings, and are referred
to in CPPTRAJ input by using a dollar sign ’$’ prefix.
For example, the following input will load files my.parm7 and my.rst7:
set PREFIX = my
trajin $PREFIX.parm7
trajin $PREFIX.rst7
For example, the following input will print info for the last 10 atoms in a topology to ’last10.dat’:
set Natom = atoms inmask *
last10 = $Natom – 10
show
atoms “@$last10 – $Natom” out last10.dat