htmd.kinetics module#
- class htmd.kinetics.Kinetics(model: Model, temperature: float, concentration: float = 1, source: int | None = None, sink: int | None = None)#
Bases:
objectConstructor for the Kinetics class
- Parameters:
model (
Model) – The model from which this class will calculate the kinetics.temperature (float) – The simulation temperature in Kelvin.
concentration (float, optional) – If a ligand is contained in the simulation, give the concentration of the ligand in Molar.
source (int, optional) – The source macrostate. If None it will be detected as the most disassociated state or the most extended conformation.
sink (int, optional) – The sink macrostate. If None it will be calculated as the macrostate with the highest equilibrium population.
Examples
>>> kin = Kinetics(model, temperature=300, concentration=0.015)
Methods
Attributes
- getRates(source: int | list | None = None, sink: int | list | None = None, states: str = 'macro', _logger: bool = True) Rates#
Get the rates between two (sets of) states.
- Parameters:
source (int or list, optional) – The state index (or list of indices) to use as source. If None, uses the source detected at construction time.
sink (int or list, optional) – The state index (or list of indices) to use as sink. If None, uses the sink detected at construction time.
states (str, optional) – The state type of the states given. Either
'macro'or'micro'.
- Returns:
rates – A Rates object containing the computed rates.
- Return type:
Examples
>>> kin = Kinetics(model, temperature=300, concentration=0.015) >>> r = kin.getRates() >>> print(r) >>> dg = r.g0eq >>> r = kin.getRates(source=4, sink=[0, 1, 2, 3])
- plotFluxPathways(statetype: str = 'macro', mode: str = 'net_flux', fraction: float = 1.0, plot: bool = True, save: str | None = None, results: bool = False)#
Plot flux pathways between source and sink state.
The flux is in units of transition events per lag time used to construct the Markov model.
- Parameters:
statetype (str, optional) – What type of states to plot. One of
'macro','coarse', or'micro'.mode (str, optional) – Type of fluxes to plot. Either
'net_flux'or'gross_flux'.fraction (float, optional) – Fraction of fluxes for which to report pathways. Does not change the plot, only the text output.
plot (bool, optional) – If set to False the plot will not show up in a figure.
save (str, optional) – If a path is passed, the plot will be saved to the specified file.
results (bool, optional) – Set to True to return fluxes, paths and path_fluxes.
- plotMarkovModel(plot: bool = True, save: str | None = None)#
Plot graph of transition probabilities.
- plotRates(rates: tuple = ('mfptoff', 'mfpton', 'g0eq'))#
Plot the MFPT on, off and free energy of all macrostates to the sink state.
- Parameters:
rates (tuple, optional) – Specify which rates to plot. Options are
('mfptoff', 'mfpton', 'g0eq', 'kdeq', 'kon', 'koff').
Examples
>>> kin = Kinetics(model, temperature=300, concentration=0.015) >>> kin.plotRates()
- class htmd.kinetics.Rates(mfpton: float | None = None, mfptoff: float | None = None, kon: float | None = None, koff: float | None = None, kdeq: float | None = None, g0eq: float | None = None)#
Bases:
objectA class containing a set of rates
- Parameters:
mfpton (float) – The mean first passage time of going from source to sink
mfptoff (float) – The mean first passage time of going from sink to source
kon (float) – The Kon rate (association constant) from source to sink
koff (float) – The Koff rate (dissociation constant) from sink to source
kdeq (float) – The Kd, calculated from the equilibrium probability
g0eq (float) – The free energy between source and sink, calculated from the equilibrium probability