pydna_epbd.simulation package#

Submodules#

pydna_epbd.simulation.aggregate_outputs_and_write module#

pydna_epbd.simulation.aggregate_outputs_and_write.aggregate_outputs_for_single_temp(list_of_monitors, input_configs, out_filepath)[source]#

Collect outputs of all the monitors from independent iterations and save them as dictionary object. An example output pickle file looks like the following when only the bubble and coordinate monitors are switched on: {“bubbles”: numpy.ndarray, “coord”: numpy.ndarray}

Parameters:
  • list_of_monitors (list) – List of monitors.

  • input_configs (InputConfigs) – An InputConfigs object.

  • out_filepath (str) – Directory path to save the simulation output.

pydna_epbd.simulation.constants module#

pydna_epbd.simulation.dna module#

class pydna_epbd.simulation.dna.DNA(seq)[source]#

Bases: object

The DNA object for MCMC simulation.

Initialize a DNA object from an input DNA sequence.

Parameters:

seq (str) – A DNA sequence. The characters are supposed to be in {A,C,G,T} (upper case).

reset()[source]#

A DNA object is initialized with coordinates (left and right bases), the distances among them, bp energies, total energy, stacking terms, hydrogen bond types and other constants.

pydna_epbd.simulation.mc_simulation module#

class pydna_epbd.simulation.mc_simulation.Simulation(dna: DNA)[source]#

Bases: object

Init Simulation object.

Parameters:

dna (DNA) – A DNA object to run simulation on it.

execute(monitors: Monitors, total_steps, preheating_steps)[source]#

Execute the simulation for total_steps (preheating+post_preheating).

Parameters:
  • monitors (Monitors) – Record different aspects of MCMC simulation of pyDNA-EPBD model.

  • total_steps (int) – Preheating steps + Post preheating steps.

  • preheating_steps (int) – Number of preheating steps, when mostly monitors do not collect anything.

init_temp(temperature)[source]#

Init simulation temperature.

Parameters:

temperature (float) – Temperature in Kelvin.

pydna_epbd.simulation.mc_simulation.random()#

pydna_epbd.simulation.simulation_steps module#

pydna_epbd.simulation.simulation_steps.run_sequences(sequences, input_configs)[source]#

Main function to run MCMC simulations for all DNA sequences. This initializes 100 or the number of available cpu cores-1 cpus to parallaly run n_iterations.

Parameters:
  • sequences (list) – List of tuples. Format: [(“seq_output_dir”, “seq_id”, “seq”)]

  • input_configs (InputConfigs) – A InputConfigs object contaning all configurations.

pydna_epbd.simulation.simulation_steps.run_single_iteration(n_preheating_steps, n_steps_after_preheating, seq_id, seq, temp, iter_no)[source]#

This runs a single MCMC simulation iteration.

Parameters:
  • n_preheating_steps (int) – Number of preheating steps (from input config).

  • n_steps_after_preheating (int) – Number of post preheating steps (from input config).

  • seq_id (str) – Seq-id attached to each input sequence.

  • seq (str) – DNA sequence.

  • temp (float) – Temperature in Kelvin (from input config).

  • iter_no (int) – Iteration index.

Returns:

A Monitors object.

Return type:

Monitors

Module contents#