mythos.observables.melting_temp

Melting temperature observable.

Attributes

TARGETS

Classes

MeltingTemp

Computes the melting temperature of a duplex using umbrella sampling.

Functions

jax_interp1d(→ jax.numpy.ndarray)

Simple linear interpolation function using JAX.

compute_finf(→ jax.numpy.ndarray)

Finite size correction to bound:unbound ratio.

find_melting_temp(→ float)

Find the temperature at which the concentration of single strands = 0.5 * duplex concentration.

compute_curve_width(→ float)

Find the width of the melting curve.

Module Contents

mythos.observables.melting_temp.TARGETS
mythos.observables.melting_temp.jax_interp1d(x: jax.numpy.ndarray, y: jax.numpy.ndarray, x_new: float) jax.numpy.ndarray[source]

Simple linear interpolation function using JAX.

Parameters:
  • x – Array of x coordinates

  • y – Array of y coordinates

  • x_new – Point(s) at which to interpolate

Returns:

Interpolated y value(s)

mythos.observables.melting_temp.compute_finf(ratio: jax.numpy.ndarray) jax.numpy.ndarray[source]

Finite size correction to bound:unbound ratio.

mythos.observables.melting_temp.find_melting_temp(temperatures: jax.numpy.ndarray, ratios: jax.numpy.ndarray) float[source]

Find the temperature at which the concentration of single strands = 0.5 * duplex concentration.

Parameters:
  • temperatures – Array of temperature values

  • ratios – Array of unbound:bound ratio values corresponding to each temperature

  • target_ratio – The ratio value to find (default: 0.5)

Returns:

The interpolated temperature where ratio = target_ratio

mythos.observables.melting_temp.compute_curve_width(temperatures: jax.numpy.ndarray, ratios: jax.numpy.ndarray) float[source]

Find the width of the melting curve.

defined as the temperature separation between unbound:bound ratio = 0.2 and unbound:bound ratio = 0.8

Parameters:
  • temperatures – Array of temperature values

  • ratios – Array of unbound:bound ratio values corresponding to each temperature

Returns:

The width of the interpolated temperature curve between 0.2 and 0.8

class mythos.observables.melting_temp.MeltingTemp[source]

Bases: mythos.observables.base.BaseObservable

Computes the melting temperature of a duplex using umbrella sampling.

The melting temperature is defined as the temperature at which the concentration of DNA duplexes is double that of the concentration of single strands.

Parameters:
  • sim_temperature – float. the temperature at which the SimulatorTrajectory was collected, in sim. units.

  • temperature_range – a vector containing the temperatures to extrapolate the SimulatorTrajectory data to (via histogram reweighting), in sim. units.

  • energy_config – Energy configurations.

  • energy_fn_builder – Energy function builder.

sim_temperature: float
temperature_range: jax.numpy.ndarray
energy_fn: collections.abc.Callable
__call__(trajectory: mythos.simulators.io.SimulatorTrajectory, bind_states: jax.numpy.ndarray, umbrella_weights: jax.numpy.ndarray, opt_params: mythos.utils.types.PyTree) float[source]

Calculate the melting temperature.

Parameters:
  • trajectory (jd_traj.Trajectory) – the trajectory to calculate the melting temperature for

  • bind_states (jnp.ndarray) – an array of the sampled states of the “bond” order parameter

  • umbrella_weights (jnp.ndarray) – an N-dimensional array containing umbrella sampling weights

  • opt_params – the parameters to optimize; use the current vals in building the energy functions

Returns:

the melting temperature in simulation units

Return type:

float

get_extrap_ratios(trajectory: mythos.simulators.io.SimulatorTrajectory, bind_states: jax.numpy.ndarray, umbrella_weights: jax.numpy.ndarray, opt_params: mythos.utils.types.PyTree) float[source]

Calculate the bound:unbound ratios at the extrapolated temperatures.

get_melting_temperature(trajectory: mythos.simulators.io.SimulatorTrajectory, bind_states: jax.numpy.ndarray, umbrella_weights: jax.numpy.ndarray, opt_params: mythos.utils.types.PyTree) float[source]

Calculate the melting temperature.

get_melting_curve(trajectory: mythos.simulators.io.SimulatorTrajectory, bind_states: jax.numpy.ndarray, umbrella_weights: jax.numpy.ndarray, opt_params: mythos.utils.types.PyTree) tuple[jax.numpy.ndarray, jax.numpy.ndarray][source]

Calculate the melting curve.

get_melting_curve_width(trajectory: mythos.simulators.io.SimulatorTrajectory, bind_states: jax.numpy.ndarray, umbrella_weights: jax.numpy.ndarray, opt_params: mythos.utils.types.PyTree) float[source]

Calculate the melting curve width.