filter
Filter frames for subsequent Actions using data sets and user defined criteria.
filter {<dataset arg> min <min> max <max> ...} [out <file> [name <setname>]] {[multi] | [filterset <set> [newset <newname>]] [countout <countfile>]}
<dataset arg>
Data set name(s) to use for filtering
min <min>
Allow values greater than <min> in dataset(s).
max <max>
Allow values greater than <max> in dataset(s).
[out <file>]
File containing 1 for frames that were allowed, 0 for frames that were filtered.
[name <setname>]
Filtered data set name containing 1 for allowed frames, 0 for filtered frames.
[multi]
Filter each set separately instead of all together (creates filter set for each input set). Cannot be used with ‘filterset’.
[filterset ]
If specified, will be filtered to only contain data that satisfies cutoffs. Cannot be used with ‘multi’.
[newset ]
If specified a new set will be created from ‘filterset’ instead of replacing ‘filterset’.
[countout ]
If specified, write number of elements passed and filtered to . Cannot be used with ‘multi’.
Sets Created (not ‘multi’)
[setname]
For each input element contains 1 for elements that passed, 0 otherwise.
<setname> [npassed]
Number of elements that passed.
<setname> [nfiltered]
Number of elements filtered out.
Sets Created (‘multi’)
<setname>: <idx>
For each input set (number with , starting from 0) contains 1 for elements that passed, 0 otherwise.
For all following actions, only include frames that are between <min>
and <max>
of data sets in <dataset arg>
. There must be at least one <min>
and <max>
argument, and there must be as many <min>
/<max>
arguments as there are specified data sets. If multi
is specified then only filter data sets will be created for each data set instead. If filterset
is specified, the specified will be modified to only contain ‘1’ frames; cannot be used with ‘multi’. If newset
is also specified, a new set will be created containing the ‘1’ frames instead. The filterset
functionality only works for 1D scalar sets. If countout
is specified, the final number of elements passed and filtered out will be written to <countfile>
.
For example, to write only frames in-between an RMSD of 0.7-0.8 Angstroms for a given input trajectory:
trajin tz2.truncoct.nc rms R1 first :2-11 filter R1 min 0.7 max 0.8 out filter.dat outtraj maxmin.crd
The output trajectory will only contain frames that meet the RMSD requirement, and the filter.dat file can be used to see which frames those were that were output. A similar command that can be used with data that already exists (e.g. it has been read in with readdata) is datafilter.