keep

Keep specified atoms in system.

keep [ bridgedata <bridge data set> 
     [nbridge <#>] 
     [nobridgewarn] 
     [bridgeresname <res name>] bridgeresonly <resrange>] ] 
     [keepmask <atoms to keep>]
     [charge <new charge>] 
     [outprefix <prefix>] 
     [nobox] 
     [parmout <filename>]
     [parmopts <comma-separated-list>]

bridgedata <bridge data set> Data set containing bridge ID strings from the hbond command.
nbridge <#> Number of bridging residues to keep (default 1).
nobridgewarn If specified, suppress warnings for when active # bridges does not equal requested number.
bridgeresname <res name> Name of bridging residues (default ‘WAT’).
bridgeresonly <range> If specified, only keep bridges that bridge residues in the <resrange> list.
keepmask <atoms to keep> Mask of atoms to keep.
charge <new charge> Scale charges so total charge of remaining atoms matches the specified <new charge>.
outprefix <prefix> Write modified topology to <prefix>.<originalname>
[nobox] Remove any box information from the modified topology.
parmout <filename> Write modified topology to <filename>.
parmopts <list> Options for writing topology file.

Keep only specified atoms (opposite of strip). This can also be used in conjunction with output from the hbond command to retain solute and only bridging residues (e.g. bridging waters). For example, the following run generates bridging data with the ‘hbond’ command in a rst pass, then uses the bridge ID data to retain only 1 single bridging water between residues 10 and 11:

parm tz2.ortho.parm7 
trajin tz2.ortho.nc 
# First pass, generate bridge time series 
hbond hb solventacceptor :WAT@O solventdonor :WAT out hb.dat 
run 
# Second pass, retain only frames where the bridge is present 
# for residues 10 and 11. 
keep bridgedata hb[ID] nbridge 1 bridgeresonly 10,11 parmout keep.parm7 
# Write trajectory 
trajout keep.nc 
run

This run reads in bridge ID data from a previous hbond run and uses it to keep only residues 10, 11, and a bridging water:

parm tz2.ortho.parm7 
trajin tz2.ortho.nc 
readdata hb.dat 
keep keepmask :10,11 bridgedata hb.dat:5 nbridge 1 bridgesonly 10,11 parmout keep.10.11.parm7 
trajout keep.10.11.nc 
run