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)
  1. Use the object instance for subsequent calculations

for primer in primer_list:
    print(oligo_calc.calc_tm(primer))  # Print the melting temp
  1. (optional) You can update an individual parameter at any time

oligo_calc.mv_conc = 80  # Increase the monovalent ion conc to 80 mM
class primer3.thermoanalysis.ThermoAnalysis(*args, **kwargs)
calcEndStability(seq1, seq2)

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

Parameters:
  • seq1 (Union[str, bytes]) – sequence string 1

  • seq2 (Union[str, bytes]) – sequence string 2

Returns:

class`ThermoResult`

Return type:

Computed end stability

calcHairpin(seq1, output_structure=False)

Deprecated Calculate the hairpin formation thermodynamics of a DNA sequence, seq1

Parameters:
  • seq1 (Union[str, bytes]) – (str | bytes) sequence string 1

  • output_structure (bool) – If True, build output structure.

Return type:

ThermoResult

Returns:

Computed hairpin ThermoResult

calcHeterodimer(seq1, seq2, output_structure=False)

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

Parameters:
  • seq1 (Union[str, bytes]) – (str | bytes) sequence string 1

  • seq2 (Union[str, bytes]) – (str | bytes) sequence string 2

  • output_structure (bool) – If True, build output structure.

Returns:

class`ThermoResult`

Return type:

Computed heterodimer

calcHomodimer(seq1, output_structure=False)

Deprecated Calculate the homodimer formation thermodynamics of a DNA sequence, seq1

Parameters:
  • seq1 (Union[str, bytes]) – (str | bytes) sequence string 1

  • output_structure (bool) – If True, build output structure.

Return type:

ThermoResult

Returns:

Computed homodimer ThermoResult

calcTm(seq1)

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

Parameters:

seq1 (Union[str, bytes]) – (str | bytes) sequence string 1

Return type:

float

Returns:

floating point Tm result

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 calc_hairpin(), calc_homodimer(), calc_heterodimer(), or calc_end_stability() calculation.

ascii_structure_lines

ASCII structure representation split into individual lines

e.g.:

[
    'SEQ             -    T CCT-   A   TTGCTTTGAAACAATTCACCATGCAGA',
    'SEQ          TGC GATG G    GCT TGC                           ',
    'STR          ACG CTAC C    CGA ACG                           ',
    'STR    AACCTT   T    T TTAT   G   TAGGCGAGCCACCAGCGGCATAGTAA-',
]
check_exc()

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.

Raises:

RuntimeError – Message of internal C error

dg

delta G (Gibbs free energy) of the structure (cal/mol)

dh

delta H (entropy) of the structure (cal/mol)

ds

delta S (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

todict()
Parameters:

pts – precision to round floats to

Returns:

dictionary form of the ThermoResult