Low-level thermodynamic analysis

primer3.thermoanalysis

Contains Cython functions and classes that enable repeated thermodynamic calculations using common calculation parameters.

Calculations are performed under the following paradigm:

  1. Instantiate ThermoAnalysis object with appropriate parameters

    oligo_calc = ThermoAnalysis(mv_conc=50, dv_conc=0.2)

  2. Use the object instance for subsequent calculations

    for primer in primer_list:

    print(oligo_calc.calcTm(primer)) # Print the melting temp

  3. (optional) You can update an individual parameter at any time

    oligo_calc.mv_conc = 80 # Increaase the monovalent ion conc to 80 mM

class primer3.thermoanalysis.ThermoAnalysis

Python class that serves as the entry point for thermodynamic calculations. Should be instantiated with the proper thermodynamic parameters for seqsequence calculations (salt concentrations, correction methods, limits, etc.). See module docstring for more information.

calcEndStability()

Calculate the 3’ end stability of DNA sequence seq1 against DNA sequence seq2

calcHairpin()

Calculate the hairpin formation thermodynamics of a DNA sequence, seq1

calcHeterodimer()

Calculate the heterodimer formation thermodynamics of two DNA sequences, seq1 and seq2

calcHomodimer()

Calculate the homodimer formation thermodynamics of a DNA sequence, seq1

calcTm()

Calculate the melting temperature (Tm) of a DNA sequence (deg. C).

dna_conc

Concentration of DNA oligos (nM)

dntp_conc

Concentration of dNTPs (mM)

dv_conc

Concentration of divalent cations (mM)

max_loop

Maximum hairpin loop size (bp)

misprimingCheck()

Calculate the heterodimer formation thermodynamics of a DNA sequence, putative_seq with a list of sequences relative to a melting temperature threshold

Parameters:
  • putative_seq (str) –
  • sequences (iterable of str) –
  • tm_threshold (double) – melting temperature threshold
Returns:

is_offtarget (bool), max_offtarget_seq_idx (int), max_offtarget_tm (double)

Return type:

Tuple of

mv_conc

Concentration of monovalent cations (mM)

salt_correction_method

Method used for salt corrections applied to melting temperature calculations. May be provided as a string (see SALT_CORRECTION_METHODS) or the respective integer representation.

temp

Simulation temperature (deg. C)

thal_type

The type of thermodynamic calculation

tm_method

Method used to calculate melting temperatures. May be provided as a string (see TM_METHODS) or the respective integer representation.

class primer3.thermoanalysis.ThermoResult

Class that wraps the thal_results struct from libprimer3 to expose tm, dg, dh, and ds values that result from a calcHairpin, calcHomodimer, calcHeterodimer, or calcEndStability calculation.

checkExc()

Check the .msg attribute of the internal thalres struct and raise a RuntimeError exception if it is not an empty string. Otherwise, return a reference to the current object.

dg

deltaG (Gibbs free energy) of the structure (cal/mol)

dh

deltaH (entropy) of the structure (cal/mol)

ds

deltaS (enthalpy) of the structure (cal/K*mol)

structure_found

Whether or not a structure (hairpin, dimer, etc) was found as a result of the calculation.

tm

Melting temperature of the structure in deg. C