mythos.observables.stretch_torsion

Utility functions for computing stretch-torsion moduli.

Classes

TwistXY

Computes the total twist of a duplex in the X-Y plane in radians.

ExtensionZ

Computes the total extension of a duplex in the Z-direction in simulation units.

Functions

single_angle_xy(→ mythos.utils.types.ARR_OR_SCALAR)

Computes the angle in the X-Y plane between adjacent base pairs.

single_extension_z(→ mythos.utils.types.ARR_OR_SCALAR)

Computes the distance between the midpoints of two base pairs.

stretch(→ tuple[float, float, float])

Computes the effective stretch modulus and relevant summary statistics from stretch experiments.

torsion(→ tuple[float, float])

Computes the relevant summary statistics from torsion experiments.

stretch_torsion(→ tuple[float, float, float])

Computes the effective stretch and torsion moduli, and twist-stretch coupling from stretch-torsion experiments.

Module Contents

mythos.observables.stretch_torsion.single_angle_xy(quartet: jax.numpy.ndarray, base_sites: jax.numpy.ndarray, displacement_fn: collections.abc.Callable) mythos.utils.types.ARR_OR_SCALAR[source]

Computes the angle in the X-Y plane between adjacent base pairs.

class mythos.observables.stretch_torsion.TwistXY[source]

Bases: mythos.observables.base.BaseObservable

Computes the total twist of a duplex in the X-Y plane in radians.

The total twist of a duplex is defined as the sum of angles in the X-Y plane between adjacent base pairs.

Args: - quartets: a (n_quartets, 2, 2) array containing the pairs of adjacent base pairs - displacement_fn: a function for computing displacements between two positions

quartets: jax.numpy.ndarray
displacement_fn: collections.abc.Callable
__post_init__() None[source]

Validate the input.

__call__(trajectory: mythos.simulators.io.SimulatorTrajectory) mythos.utils.types.ARR_OR_SCALAR[source]

Calculate the total twist in the X-Y plane in radians.

Parameters:

trajectory (jd_traj.Trajectory) – the trajectory

Returns:

the total twist in radians for each state, so expect a size of (n_states,)

Return type:

jd_types.ARR_OR_SCALAR

mythos.observables.stretch_torsion.single_extension_z(center: mythos.utils.types.Arr_Nucleotide_3, bp1: jax.numpy.ndarray, bp2: jax.numpy.ndarray, displacement_fn: collections.abc.Callable) mythos.utils.types.ARR_OR_SCALAR[source]

Computes the distance between the midpoints of two base pairs.

class mythos.observables.stretch_torsion.ExtensionZ[source]

Bases: mythos.observables.base.BaseObservable

Computes the total extension of a duplex in the Z-direction in simulation units.

The total extension of a duplex is defined as the distance between the midpoints of two pre-specified base pairs in the Z-direction.

Args: - bp1: a (2,) array specifying the indices of the first base pair - bp2: a (2,) array specifying the indices of the second base pair - displacement_fn: a function for computing displacements between two positions

bp1: jax.numpy.ndarray
bp2: jax.numpy.ndarray
displacement_fn: collections.abc.Callable
__post_init__() None[source]

Validate the input.

__call__(trajectory: mythos.simulators.io.SimulatorTrajectory) mythos.utils.types.ARR_OR_SCALAR[source]

Calculate the total extension in simulation units.

Parameters:

trajectory (jd_traj.Trajectory) – the trajectory

Returns:

the total extension for each state, so expect a size of (n_states,)

Return type:

jd_types.ARR_OR_SCALAR

mythos.observables.stretch_torsion.stretch(forces: jax.numpy.ndarray, extensions: jax.numpy.ndarray) tuple[float, float, float][source]

Computes the effective stretch modulus and relevant summary statistics from stretch experiments.

Following Assenza and Perez (JCTC 2022), the effective stretch modulus can be computed as

\[\tilde{S} = \frac{L_0}{A_1}\]

where A_1 and L_0 are the slope and offset, respectively, of a linear force-extension fit.

Parameters:
  • forces (jnp.ndarray) – the forces applied to the polymer

  • extensions (jnp.ndarray) – the equilibrium extensions under the applied forces

Returns:

the slope and offset of the linear fit, and the effective stretch modulus

Return type:

Tuple[float, float, float]

mythos.observables.stretch_torsion.torsion(torques: jax.numpy.ndarray, extensions: jax.numpy.ndarray, twists: jax.numpy.ndarray) tuple[float, float][source]

Computes the relevant summary statistics from torsion experiments.

Following Assenza and Perez (JCTC 2022), the torsional modulus and twist-stretch coupling can be computed via linear fits to the extension and twist of a duplex under torque (when combined with similar statistics from stretching experiments). This function computes the slopes of these linear fits

Parameters:
  • torques (jnp.ndarray) – the torques applied to the polymer

  • extensions (jnp.ndarray) – the equilibrium extensions under the applied torques

  • twists (jnp.ndarray) – the equilibrium twists under the applied torques

Returns:

the slopes of the linear fits to the extensions and twists, respectively

Return type:

Tuple[float, float]

mythos.observables.stretch_torsion.stretch_torsion(forces: jax.numpy.ndarray, force_extensions: jax.numpy.ndarray, torques: jax.numpy.ndarray, torque_extensions: jax.numpy.ndarray, torque_twists: jax.numpy.ndarray) tuple[float, float, float][source]

Computes the effective stretch and torsion moduli, and twist-stretch coupling from stretch-torsion experiments.

Parameters:
  • forces (jnp.ndarray) – the forces applied to the polymer

  • force_extensions (jnp.ndarray) – the equilibrium extensions under the applied forces

  • torques (jnp.ndarray) – the torques applied to the polymer

  • torque_extensions (jnp.ndarray) – the equilibrium extensions under the applied torques

  • torque_twists (jnp.ndarray) – the equilibrium twists under the applied torques

Returns:

the effective stretch modulus, torsional modulus, and twist-stretch coupling

Return type:

Tuple[float, float, float]