itcsimlib.model_ising module

Provides Ising type lattice+ligand binding models for itcsimlib.

class itcsimlib.model_ising.Ising(nsites=3, circular=True, *args, **kwargs)[source]

Bases: itcsimlib.itc_model.ITCModel

An model based on ligand binding to an Ising lattice.

nconfigs

The total number of possible configurations of the lattice.

Type:int
configs

The occupation state (1=bound, 0=unbound) of each site in each lattice configuration.

Type:list of list of ints
bound

The number of ligands bound to each lattice configuration.

Type:list of ints
weights

The absolute (normalized) probability of each configuration.

Type:list of floats
gibbs

The free energy of each configuration.

Type:list of floats
enthalpies

The enthalpy of each configuration.

Type:list of floats
precision

The precision in ligand concentration required for convergence during set_probabilities()

Type:float
parameter_symbols

Convenience container for the sympy symbols corresponding to the model parameter names, ultimately used to construct the symbolic configuration expressions.

Type:dict of sympy symbols
config_expressions

The symbolic expression of the configuration’s free energy.

Type:list of sympy expressions
add_parameter(name, type, **kwargs)[source]

Wrapper for the typical ITC model add_parameter, with the added tweak that a sympy symbol is created for eventually generating the model’s partition function.

get_site_occupancy(config, site)[source]

Return whether a given site is occupied or not, correctly accounting for circular lattices and lattice indicies <0 or >n.

Parameters:
  • config (int) – The lattice configuration index
  • site (int) – The lattice site index
Returns:

Whether the site is occupied (bound), or None if the lattice is nonlinear and the site index is meaningless

Return type:

boolean or None

set_probabilities(totalP, totalL, T)[source]

Set the normalized weights (probabilities) of each configuration at the specified free energies and component concentrations.

Parameters:
  • totalP (float) – The total concentration of binding lattices.
  • totalL (float) – The total concentration of ligands.
  • T (float) – The experimental temperature.
Returns:

The free concentration of ligand.

Return type:

float

Q(T0, T, concentrations)[source]

Return the enthalpy of the system at each of the specified component concentrations.

Parameters:
  • T0 (float) – The reference temperature of the simulation.
  • T (float) – The temperature of the experiment to simulate.
  • concentrations (list of dicts) – The concentrations of each component at each titration point.
Returns:

The total enthalpy of the system at each injection point.

Return type:

list of floats

get_partition_function(substitute_Ks=True, full_simplify=True)[source]

Return the partition function of the binding model as a sympy expression.

Parameters:
  • substitute_Ks (boolean) – Improve condensation of the partition function by converting free energies to binding constants, where possible.
  • full_simplify (boolean) – Perform a final reduction of terms for the compiled partition function?
Returns:

The symbolic partition function for the model.

Return type:

sympy object

draw_lattices(file=None, size=1.0, dG_format='%0.1f', dG_tolerance=6)[source]

Draw a PDF depicting the energetically-unique configurations of the model, with annotations.

Parameters:
  • file (string (or None)) – The path at which to save the file.
  • size (float) – The radius (for circular lattices) or width (for linear lattices), in cm of the depictions.
  • dG_format (string) – The formatting string to use when printing configuration free energies.
  • dG_tolerance (float) – The tolerance (in post-decimal digits) to use when determining configuration free energy degeneracies.
Returns:

Return type:

pyx.canvas

Notes

Uses the current model parameter values to determine energetically degenerate (w.r.t. free energy) configurations.

set_energies(T0, T)[source]

Set the free and enthalpic energy of each lattice configuration using the current parameter values. This method is a stub that child classes should replace.

Parameters:
  • T0 (float) – The reference temperature of the simulation.
  • T (float) – The current temperature of the system.
Returns:

Return type:

None

class itcsimlib.model_ising.FullAdditive(nsites=3, circular=1, *args, **kwargs)[source]

Bases: itcsimlib.model_ising.Ising

An Ising-type model, in which ligands bind to either a linear or circular lattice. Coupling can occur to both unoccupied and occupied lattice points.

set_energies(T0, T)[source]

Sets energies for each configuration. See model description.

class itcsimlib.model_ising.HalfAdditive(nsites=3, circular=1, *args, **kwargs)[source]

Bases: itcsimlib.model_ising.Ising

An Ising-type model, in which ligands bind to either a linear or circular lattice. Coupling only occurs between occupied lattice points.

set_energies(T0, T)[source]

Sets energies for each configuration. See model description.

class itcsimlib.model_ising.NonAdditive(nsites=3, circular=1, *args, **kwargs)[source]

Bases: itcsimlib.model_ising.Ising

An Ising-type model, in which ligands bind to either a linear or circular lattice. Binding energy depends upon whether zero, one, or both neighboring sites are occupied.

set_energies(T0, T)[source]

Sets energies for each configuration. See model description.