mythos.observables.melting_temp =============================== .. py:module:: mythos.observables.melting_temp .. autoapi-nested-parse:: Melting temperature observable. Attributes ---------- .. autoapisummary:: mythos.observables.melting_temp.TARGETS Classes ------- .. autoapisummary:: mythos.observables.melting_temp.MeltingTemp Functions --------- .. autoapisummary:: mythos.observables.melting_temp.jax_interp1d mythos.observables.melting_temp.compute_finf mythos.observables.melting_temp.find_melting_temp mythos.observables.melting_temp.compute_curve_width Module Contents --------------- .. py:data:: TARGETS .. py:function:: jax_interp1d(x: jax.numpy.ndarray, y: jax.numpy.ndarray, x_new: float) -> jax.numpy.ndarray Simple linear interpolation function using JAX. :param x: Array of x coordinates :param y: Array of y coordinates :param x_new: Point(s) at which to interpolate :returns: Interpolated y value(s) .. py:function:: compute_finf(ratio: jax.numpy.ndarray) -> jax.numpy.ndarray Finite size correction to bound:unbound ratio. .. py:function:: find_melting_temp(temperatures: jax.numpy.ndarray, ratios: jax.numpy.ndarray) -> float Find the temperature at which the concentration of single strands = 0.5 * duplex concentration. :param temperatures: Array of temperature values :param ratios: Array of unbound:bound ratio values corresponding to each temperature :param target_ratio: The ratio value to find (default: 0.5) :returns: The interpolated temperature where ratio = target_ratio .. py:function:: compute_curve_width(temperatures: jax.numpy.ndarray, ratios: jax.numpy.ndarray) -> float Find the width of the melting curve. defined as the temperature separation between unbound:bound ratio = 0.2 and unbound:bound ratio = 0.8 :param temperatures: Array of temperature values :param 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 .. py:class:: MeltingTemp Bases: :py:obj:`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. :param sim_temperature: float. the temperature at which the SimulatorTrajectory was collected, in sim. units. :param temperature_range: a vector containing the temperatures to extrapolate the SimulatorTrajectory data to (via histogram reweighting), in sim. units. :param energy_config: Energy configurations. :param energy_fn_builder: Energy function builder. .. py:attribute:: sim_temperature :type: float .. py:attribute:: temperature_range :type: jax.numpy.ndarray .. py:attribute:: energy_fn :type: collections.abc.Callable .. py:method:: __call__(trajectory: mythos.simulators.io.SimulatorTrajectory, bind_states: jax.numpy.ndarray, umbrella_weights: jax.numpy.ndarray, opt_params: mythos.utils.types.PyTree) -> float Calculate the melting temperature. :param trajectory: the trajectory to calculate the melting temperature for :type trajectory: jd_traj.Trajectory :param bind_states: an array of the sampled states of the "bond" order parameter :type bind_states: jnp.ndarray :param umbrella_weights: an N-dimensional array containing umbrella sampling weights :type umbrella_weights: jnp.ndarray :param opt_params: the parameters to optimize; use the current vals in building the energy functions :returns: the melting temperature in simulation units :rtype: float .. py:method:: 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 Calculate the bound:unbound ratios at the extrapolated temperatures. .. py:method:: 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 Calculate the melting temperature. .. py:method:: 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] Calculate the melting curve. .. py:method:: 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 Calculate the melting curve width.