clophfit.prenspire.thermo_plot#
Drawing helpers for the van’t Hoff figure.
The joint fit in clophfit.prenspire.thermo already handles both
titration kinds correctly: a pH plate fits pKa(T) and a chloride
plate fits pKd(T) and reports Kd on its native mM scale. These
helpers put the figure on the same footing, so the curve drawn is the
curve that was fitted.
The two kinds differ in three places:
the model: Henderson-Hasselbalch for pH, Langmuir for a ligand;
the axis: pH is a linear, dimensionless scale, a ligand concentration spans decades and is drawn on a log axis;
the enthalpy sign: for a pH plate
dH = +ln10 R b, for a ligandd ln Kd / d(1/T) = -dH/Rgives the opposite sign.
Classes#
How one sample's van't Hoff row must be drawn. |
Functions#
|
Draw the fitted model curve of one temperature, on its own titration's axis. |
|
Give the enthalpy of the equilibrium in J/mol, with the right sign. |
|
Give the constant of one temperature, as the right panel plots it. |
|
Give the fitted constant along a range of inverse temperatures. |
|
How one sample's van't Hoff row must be drawn. |
Module Contents#
- class clophfit.prenspire.thermo_plot.VanthoffAxes#
Bases:
NamedTupleHow one sample’s van’t Hoff row must be drawn.
- left_x: str#
Label of the left panel’s titrant axis.
- left_y: str#
Label of the left panel’s signal axis.
- left_log: bool#
Whether the left panel’s titrant axis is logarithmic.
- right_y: str#
Label of the right panel’s constant axis.
- right_log: bool#
Whether the right panel’s constant axis is logarithmic.
- clophfit.prenspire.thermo_plot.vanthoff_curve(model, temp, grid, plateaus)#
Draw the fitted model curve of one temperature, on its own titration’s axis.
- Parameters:
model (VanthoffModel) – The joint fit of the sample.
temp (str) – Temperature label; the label the model carries.
grid (np.ndarray) – Titrant values to evaluate the curve at.
plateaus (tuple[float, float]) – Fitted (S0, S1) of the band the curve is drawn for.
- Returns:
The modelled signal at every grid point.
- Return type:
np.ndarray
- clophfit.prenspire.thermo_plot.vanthoff_enthalpy(model)#
Give the enthalpy of the equilibrium in J/mol, with the right sign.
A pH plate fits
pKa(T) = A + B (1/T - m)andpKa = -log10 Ka, sodH = +ln10 R B. A ligand plate fitspKd(T), and sinced ln Kd / d(1/T) = -dH/Rthe same coefficient carries the opposite sign of enthalpy.- Parameters:
- Return type:
float
- clophfit.prenspire.thermo_plot.vanthoff_right_point(model, temp)#
Give the constant of one temperature, as the right panel plots it.
A pH plate’s pKa is already the plotted quantity. A ligand plate’s Kd is exponential in 1/T, so it is plotted on a log axis: the panel then shows the same Kd in mM that the table reports, read next to it.
- Parameters:
model (VanthoffModel) – The joint fit of the sample.
temp (str) – Temperature label.
- Returns:
The plotted value and its standard error, on the plotted scale.
- Return type:
tuple[float, float]
- clophfit.prenspire.thermo_plot.vanthoff_right_line(model, inv)#
Give the fitted constant along a range of inverse temperatures.
The joint fit carries the constant as
A + B (1/T - m): a pKa for a pH plate, a pKd for a ligand plate. A ligand’s plotted constant is the Kd, so the line is the exponential of that.- Parameters:
model (VanthoffModel) – The joint fit of the sample.
inv (np.ndarray) – Inverse temperatures [1/K].
- Returns:
The constant at every inverse temperature, on the plotted scale.
- Return type:
np.ndarray
- clophfit.prenspire.thermo_plot.vanthoff_axes(model)#
How one sample’s van’t Hoff row must be drawn.
- Parameters:
model (VanthoffModel) – The joint fit of the sample.
- Returns:
The labels and the log-scale flags of the two panels.
- Return type: