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.
Calculate the average residence time for how long a compound resides in
a specific state before it changes states given that it was in a
specific state of a second discrete trajectory at time \(t_0\).
This is done by computing the probability to be in the same state as at
time \(t_0\) after a lag time \(\Delta t\) as function of the
states in the second discrete trajectory. Afterwards, these
probabilities are fitted by stretched exponential functions, whose
integrals from zero to infinity are the average lifetimes of the states
in the first discrete trajectory. See also
mdtools.dtrj.remain_prob_discrete()
.
Options
- --f1
Name of the file containing the first 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. Seemdtools.file_handler.load_dtrj()
for more information about the requirements for the input file.- --f2
Name of the file containing the second discrete trajectory. The second discrete trajectory must have the same shape as the first discrete trajectory.
- -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
.- --restart
Number of frames between restarting points for calculating the remain probability. Must be an integer multiple of --every. Default:
100
.- --intermittency1
Allowed intermittency for the first discrete trajectory: 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.
- --intermittency2
Allowed intermittency for the second discrete trajectory.
- --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_discrete()
The underlying function to calculate the remain probabilities
scripts.discretization.state_lifetime
Calculate the average lifetime of the states in a discrete trajectory
scripts.discretization.plot_state_lifetime_discrete
Plot the lifetime autocorrelation function of discrete states as function of another set of discrete states
Notes
If you parse the same discrete trajectory to --f1 and --f2 you will
get the lifetime of each individual state in the input trajectory. If
you want the average lifetime of all states, use
scripts.discretization.state_lifetime
.
See mdtools.dtrj.remain_prob_discrete()
for further details.