Calculate DNA Melting Temperature in Python – Step-by-Step



This tutorial shows how to calculate DNA melting temperature (Tm) in Python using Biopython which can be installed using bioconda.

Background on Melting Temperature (Tm)

Melting temperature is the temperature at which a DNA double helix dissociates into single strands. In case you want to learn more about it. Please see the videos below:

Calculate DNA Melting Temperature

First, we need to install Biopython which can be easily done using bioconda as we show below:

$ conda install -c conda-forge biopython

Next, Biopython provides three methods to compute the melting temperature as described below by their definitions:

  • Tm_Wallace: ‘Rule of thumb’
  • Tm_GC: Empirical formulas based on GC content. Salt and mismatch corrections can be included.
  • Tm_NN: Calculation based on nearest-neighbor thermodynamics. Several tables for DNA/DNA, DNA/RNA, and RNA/RNA hybridizations are included. Correction for mismatches, dangling ends, salt concentration, and other additives are available.

Now, there are three examples on how all the methods differ from each other

>>> from Bio.SeqUtils import MeltingTemp

# Rule of thumb melting temperature
>>> MeltingTemp.Tm_Wallace(sequence)
>>> 116.0

# GC melting temperature
>>> MeltingTemp.Tm_GC(sequence)
>>> 60.98

# nearest-neighbor melting temperature
>>> MeltingTemp.Tm_NN(sequence)
>>> 62.86

Last but not least, in case you want to learn more about the melting temperature Biopython methods, please check it out here.

More Resources