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 <VAR> = {charge|mass} inmask <mask>
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
The following input will put a range of residues selected by :LYS:
set SELECTED1 = resnums inmask :1-183&:LYS Using topology: FtuFabI.NAD.TCL.parm7 Variable 'SELECTED1' set to '7-8,18,26,44,49,71,79,128,135,151,163,183'
set <VAR> = {charge|mass} inmask <mask>
Will allow variable <VAR>
to be set to the total charge/mass of atoms selected by a mask.