pydna_epbd.monitors package#

Submodules#

pydna_epbd.monitors.all_monitors module#

class pydna_epbd.monitors.all_monitors.Monitors(dna, n_preheating_steps, n_steps_after_preheating)[source]#

Bases: object

All monitors to apply for the same DNA object.

Initialize all the monitors if the corresponding switches are on/off.

Parameters:
  • dna (DNA) – A DNA object.

  • n_preheating_steps (int) – Number of preheating steps.

  • n_steps_after_preheating (int) – Number of post-preheating steps.

collect_at_iter()[source]#

Call monitors to record at the end of iterations.

collect_at_step(step_no)[source]#

Call monitors to record at post-preheating steps.

Parameters:

step_no (int) – Step number.

collect_at_step_preheat(step_no)[source]#

Call monitors to record at preheating steps.

Parameters:

step_no (int) – Step number.

update_state(seq_id, temp, iter_no)[source]#

Update state for all monitors.

Parameters:
  • seq_id (str) – Sequence id.

  • temp (float) – Simulation temperature.

  • iter_no (int) – Iteration number.

pydna_epbd.monitors.bubble_monitor module#

class pydna_epbd.monitors.bubble_monitor.BubbleMonitor(dna)[source]#

Bases: Monitor

The bubble monitor collects DNA bubbles for each bp at different thresholds. For a threshold, if a bps distance is more than the threshold, it computes the bubble length starting from that bp until the next bps distance is less than the threshold. In this implementation, the minimum and maximum bubble length are considered in between 3 and 20, inclusive. The number of thresholds are set to 20 by default from 0.5 Angstrom to 10.5 Angstrom with step size 0.5 Angstrom.

Initialize BubbleMonitor object.

Parameters:

dna (DNA) – A DNA object.

MAX_BUB_ELEM = 20#
MIN_BUB_ELEM = 3#
TRESHOLDS = [0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 5.5, 6.0, 6.5, 7.0, 7.5, 8.0, 8.5, 9.0, 9.5, 10.0]#
TRESHOLD_SIZE = 20#
collect_at_step(step_no)[source]#

Collects bubbles at every post-preheating steps.

Parameters:

step_no (int) – Step number.

pydna_epbd.monitors.coord_monitor module#

class pydna_epbd.monitors.coord_monitor.CoordMonitor(dna)[source]#

Bases: Monitor

The coordinate monitor collects each bps distance and squared-distance at every post-preheating step.

Initialize CoordMonitor object.

Parameters:

dna (DNA) – A DNA object.

collect_at_step(step_no)[source]#

Collect bps distance and squared-distance at every post-preheating step.

Parameters:

step_no (int) – Step number.

pydna_epbd.monitors.coord_monitor_verbose module#

pydna_epbd.monitors.energy_monitor module#

class pydna_epbd.monitors.energy_monitor.EnergyMonitor(dna, total_steps)[source]#

Bases: Monitor

The energy monitor collects total energy (in Kelvin) at every preheating and post preheating step.

Initialize EnergyMonitor object.

Parameters:
  • dna (DNA) – A DNA object.

  • total_steps (int) – Total number of steps.

KB = 8.61733034e-05#
collect_at_step(step_no)[source]#

Collect energies at post-preheating steps.

Parameters:

step_no (int) – Step number.

collect_at_step_preheat(step_no)[source]#

Collect energies at preheating steps.

Parameters:

step_no (int) – Step number.

pydna_epbd.monitors.flipping_monitor module#

class pydna_epbd.monitors.flipping_monitor.FlippingMonitor(dna)[source]#

Bases: Monitor

The flipping monitor collects flipping characteristics for each bp at every post preheating steps at a predefined threshold.

initialize FlippingMonitor object.

Parameters:

dna (DNA) – A DNA object.

FLIP_CUTOFF = 0.707106781186548#
collect_at_step(step_no)[source]#

Collects flipping characteristics.

Parameters:

step_no (int) – Step number.

pydna_epbd.monitors.flipping_monitor_verbose module#

class pydna_epbd.monitors.flipping_monitor_verbose.FlippingMonitorVerbose(dna)[source]#

Bases: Monitor

The flipping verbose monitor collects flipping characteristics for different thresholds.

initialize FlippingMonitor object.

Parameters:

dna (DNA) – A DNA object.

FLIP_CUTOFF = [0.707106781186548, 1.414213562373096, 2.121320343559644, 2.828427124746192, 3.53553390593274]#
FLIP_SIZES = 5#
collect_at_step(step_no)[source]#

Collects flipping characteristics considering different thresholds.

Parameters:

step_no (int) – Step number.

pydna_epbd.monitors.melting_and_fraction_many_monitor module#

class pydna_epbd.monitors.melting_and_fraction_many_monitor.MeltingAndFractionManyMonitor(dna, n_preheating_steps)[source]#

Bases: Monitor

This collects whether the DNA is melted and the fraction of DNA base-pairs melted, as in melting and fraction monitor, at many different time steps and thresholds. By default, it collects melting and fraction observations 100 time steps throughout the post preheating steps in an evenly separated manner. And twenty thresholds are chosen in between [0.5, 2.5) Angstrom with step size 0.1.

Initialize MeltingAndFractionManyMonitor object.

Parameters:
  • dna (DNA) – A DNA object.

  • n_steps_after_preheating (int) – Number of post-preheating steps.

MELT_FRACTION_SIZES = 20#
MELT_FRACTION_TIME_STEPS = 100#
MELT_FRACTION_TRESHOLDS = [0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4]#
collect_at_step(step_no)[source]#

Melting and fraction characteristics are collected at various time steps thoughout the post preheating steps.

Parameters:

step_no (int) – Step number.

pydna_epbd.monitors.melting_and_fraction_monitor module#

class pydna_epbd.monitors.melting_and_fraction_monitor.MeltingAndFractionMonitor(dna, n_steps_after_preheating)[source]#

Bases: Monitor

Melting and fraction characteristics recording monitor at predefined threhold. At the end of each iteration, this monitor decides whether the DNA is melted or not at every bp by checking that any of the bp’s average coordinate distance is less than a predefined melting threshold (here 0.5 Angstrom). In another word, if all bps average coordinate distance is more or equal to the threshold, then it is melted. In addition, the fraction computes the fraction of bps that have melted. Therefore, if the DNA melted, the fraction is 1.0.

Initialize MeltingAndFractionMonitor object.

Parameters:
  • dna (DNA) – A DNA object.

  • n_steps_after_preheating (int) – Number of post-preheating steps.

MELT_FRACTION_TRESHOLD = 0.5#
collect_at_iter()[source]#

Melting and fraction characteristics are collected at the end of the iteration.

collect_at_step(step_no)[source]#

Melting and fraction characteristics are collected at step_no.

Parameters:

step_no (int) – Step number.

pydna_epbd.monitors.monitor module#

class pydna_epbd.monitors.monitor.Monitor(dna: DNA)[source]#

Bases: object

The monitor to collect various aspects of the simulation.

Initialize Monitor object for the input DNA object.

Parameters:

dna (DNA) – A DNA object.

collect_at_iter()[source]#

The characteristics to collect at the end of each iteration. The corresponding iteration number is updated in the update_state function Optional, since not all child monitors need to record at iteration end.

collect_at_step(step_no)[source]#

The characteristics to collect at post-preheating steps. Abstract method to be implemented by the child monitors, to collect specific aspects of the MCMC simulation.

Parameters:

step_no (int) – Iteration number.

Raises:

NotImplementedError – The child monitors must implement this.

collect_at_step_preheat(step_no)[source]#

The characteristics to collect at preheating steps. Optional, since not all child monitors need to record at preheating steps.

Parameters:

step_no (int) – Iteration number.

collect_at_temp()[source]#

The characteristics to collect specifically for each temperature. The corresponding temperature is updated in the update_state function Optional, since not all child monitors need to record at temperature end.

update_state(seq_id, temp, iter_no)[source]#

State of a monitor

Parameters:
  • seq_id (str) – Sequence id.

  • temp (float) – Simulation temperature.

  • iter_no (int) – Iteration number.

Module contents#