state_lifetime

Calculate the average lifetime of the states in a discrete trajectory.

Calculate the average residence time for how long a compound resides in a specific state before it changes states. This is done by computing the probability to be in the same state as at time \(t_0\) after a lag time \(\Delta t\). Afterwards, this probability is fitted by a stretched exponential function, whose integral from zero to infinity is the average lifetime of all states in the discrete trajectory. See also the notes section of mdtools.dtrj.remain_prob().

Options

-f

Name of the file containing the discrete trajectory. The discrete trajectory must be stored as numpy.ndarray either in a binary NumPy .npy file or in a (compressed) NumPy .npz archive. See mdtools.file_handler.load_dtrj() for more information about the requirements for the input file.

-o

Output filename.

-b

First frame to read from the discrete trajectory. Frame numbering starts at zero. Default: 0.

-e

Last frame to read from the discrete trajectory. This is exclusive, i.e. the last frame read is actually END - 1. A value of -1 means to read the very last frame. Default: -1.

--every

Read every n-th frame from the discrete trajectory. Default: 1.

--nblocks

Number of blocks for block averaging. The trajectory will be split in NBLOCKS equally sized blocks, which will be analyzed independently, like if they were different trajectories. Finally, the average and standard deviation over all blocks will be calculated. Default: 1.”

--restart

Number of frames between restarting points for calculating the remain probability. Must be an integer multiple of --every. Default: 100.

--intermittency

Maximum number of frames a compound is allowed to leave its state whilst still being considered to be in this state provided that it returns to this state after the given number of frames. In other words, a compound is only considered to have left its state if it has left it for at least the given number of frames.

--continuous

If given, compounds must continuously be in the same state without interruption in order to be counted (see notes section of mdtools.dtrj.remain_prob()).

--discard-neg-start

Discard all transitions starting from a negative state (see notes section of mdtools.dtrj.remain_prob()). Must not be used together with --discard-all-neg.

--discard-all-neg

Discard all negative states (see notes section of mdtools.dtrj.remain_prob()). Must not be used together with --discard-neg-start.

--end-fit

End time for fitting the remain probability (in trajectory steps). This is inclusive, i.e. the time given here is still included in the fit. If None, the fit ends at 90% of the lag times. Default: None.

--stop-fit

Stop fitting the remain probability as soon as it falls below the given value. The fitting is stopped by whatever happens earlier: --end-fit or --stop-fit. Default: 0.01.

See also

mdtools.dtrj.remain_prob()

The underlying function to calculate the remain probability

scripts.discretization.state_lifetime_discrete

Calculate the average lifetime of the states in a discrete trajectory resolved with respect to the states in a second discrete trajectory

scripts.discretization.plot_state_lifetime

Plot the lifetime autocorrelation function of discrete states as function of lag time

Notes

If you want to compute the lifetime of each individual state in a discrete trajectory, use scripts.discretization.state_lifetime_discrete and parse the same discrete trajectory to --f1 and --f2.

See mdtools.dtrj.remain_prob() for further details.