lifetime
Perform lifetime analysis for specified data sets.
lifetime [out <filename>] <dsetarg0> [ <dsetarg1> ... ] [window <windowsize> [name <setname>]] [averageonly] [cumulative] [delta] [cut <cutoff>] [greater | less] [rawcurve] [fuzz <fuzzcut>] [nosort]
[out <filename>]
Write results to file named <filename>, and lifetime curves to ’crv.<filename>’. If performing windowed lifetime analysis, <filename> contains the fraction present over time windows, and 2 additional files are written: ’max.<filename>’, containing max lifetime over windows, and ’avg.<filename>’, containing average lifetime over windows.
<dsetarg0> [<dsetarg1> ...]
Argument(s) specifying datasets to be used.
[window <windowsize>]
Size of window (in frames) over which to calculate lifetimes/averages. If not specified lifetime/average will be calculated over all frames.
[name <setname>]
Store results in data sets with name <setname>.
[averageonly]
Just calculate averages (no lifetime analysis).
[cumulative]
Calculate cumulative lifetimes/averages over windows.
[delta]
Calculate difference from previous window average.
[cut <cutoff>]
Cutoff to use when determining if data is ’present’ (default 0.5).
[greater]
Data is considered present when above the cutoff (default).
[less]
Data is considered present when below the cutoff.
[rawcurve]
Do not normalize lifetime curves to 1.0.
[fuzz <fuzzcut>]
Ignore changes in lifetime state that are less than <fuzzcut> frames.
[nosort]
Do not sort data sets by name.
Data Sets Created:
<setname>
Number of lifetimes for each set, or if window specified fraction present over time windows.
<setname>[max]
Maximum lifetime for each set, or if window specified maximum lifetime over time windows.
<setname>[avg]
Average lifetime for each set, or if window specified average lifetime over time windows.
<setname>[curve]
Lifetime curves. The following are created only if window not specified:
<setname>[frames]
Total number of frames lifetime present for each set.
<setname>[name]
Name of each set. Perform lifetime analysis for specified data sets. Lifetime data can either be determined for the entire set, or for time windows of specified size within the set if window specified. A “lifetime” is defined as the length of time something remains ’present’; data is considered present when above or below a certain cutoff (the default is greater than 0.5, useful for analysis of hbond time series data).
For example, in the case of a hydrogen bond ’series’ data set, if a hydrogen bond is present during a frame the value is 1, otherwise it is 0. Given the hbond time series data set {1 1 1 0 1 0 0 0 1 1}, the overall fraction present is 0.6. However, there are 3 lifetimes of lengths 3, 1, and 2 ({1 1 1}, {1}, and {1 1}). The maximum lifetime is 3 and the average lifetime is 2.0, i.e. (3 + 1 + 2) / 3 lifetimes = 2.0. One can also construct a “lifetime curve”, which is constructed as the sum of all individual lifetimes. By default these curves are normalized to 1.0, but the raw curve can be obtained using the rawcurve keyword. For the example data set here the raw lifetime curve would be 3 frames long:
1 1 1 1 1 1 Curve: 3 2 1
By default data sets are sorted by name unless nosort is specified. The lifetime command can calculate lifetimes over specific time windows by using the window keyword. This can be particularly useful if one wants to get a sense for how lifetimes are changing over the course of very long time series data. In addition, averages can be calculated instead of lifetimes by specifying averageonly. Cumulative averages over windows can be obtained using the cumulative keyword, or the change from the average value in the previous window can be obtained using
the delta keyword.
The fuzz keyword can be used to try and smooth the input data by ignoring changes in state that occur for fewer frames than <fuzzcut>. For example, in the above example hbond time series data set there is a one frame change in state between the first and second lifetimes which could be interpreted as a transient breaking of the hydrogen bond. Using a <fuzzcut> value of 1, this one frame change in state would be ignored, and the data set would effectively appear to lifetime as {1 1 1 1 1 0 0 0 1 1}.
The state change between the second and third lifetimes is longer than <fuzzcut> (3 frames) and so it would remain. If window is not specified, two files are output: <filename> and crv.<filename>. The file <filename> contains overall lifetime stats for each set with format:
#Set <setname> <setname>[max] <setname>[avg] <setname>[frames] <setname>[name]
where <setname> denotes the total number of lifetimes, <setname>[max] denotes the maximum lifetime, <setname>[avg] denotes the average lifetime, <setname>[frames] denotes the total number of frames present in all lifetimes, and <setname>[name] is the data set name. The file crv.<filename> contains the lifetime curves for each set. If window is specified, four files are output: <filename>, max.<filename>, avg.<filename>, and crv.<filename>. <filename> contains the fraction “present” over each time window for each set, max.<filename> contains themaximum lifetime in each time window for each set, avg.<filename> contains the average lifetime over each window for each set, and crv.<filename> contains the overall lifetime curves for each set. For window output, Gnuplot format is recommended.
Example: hbond lifetime analysis
parm DPDP.parm7 trajin DPDP.nc hbond HB out hbond.dat @N,H,C,O series uuseries solutehb.agr \ avgout hbavg.dat printatomnum # ’run’ is used here to process the trajectory and generate hbond data run # Perform lifetime analysis runanalysis lifetime HB[solutehb] out lifehb.dat
Calculate ion lifetimes from hbond over windows of size 100 frames:
hbond ION out ion.dat solventdonor :WAT solventacceptor :WAT@O series run lifetime HB[solventhb] out ion.lifetime.100.gnu window 100