Calculate Melting Temperature (Tm) in Python

Renesh Bedre    1 minute read

The melting temperature (Tm) is a vital parameter for the success of the PCR and other hybridization experiments.

In Python, the Tm can be calculated using the Bio.SeqUtils module available in Biopython. This module has different methods for Tm calculation based on the sequence content, salt concentration, and thermodynamics parameters.

The following examples explains how to use Bio.SeqUtils module for Tm calculation.

Tm_Wallace

This method gives approximate Tm and valid for the shorter sequences (< 20 nt). This method is solely based on nucleotide content of the sequences and does not consider other factors such as presence of salt, chemical additives, etc.

For example, calculate the Tm for sequence TAGCGATGAATCC"

# load package
from Bio.SeqUtils import MeltingTemp as mt

seq = "TAGCGATGAATCC"
tm = mt.Tm_Wallace(seq) 
print(tm)

# output
38.0

The Tm of the sequence TAGCGATGAATCC is 38.0°C

GC content based method

This method gives approximate Tm based on the % GC content in the sequence.

For example, calculate the Tm for sequence `TAGCGATGACTGATCCATGACTATT”

# load package
from Bio.SeqUtils import MeltingTemp as mt

seq = "TAGCGATGACTGATCCATGACTATT"
tm = mt.Tm_GC(seq) 
print(tm)

# output
52.30

The Tm of the sequence TAGCGATGACTGATCCATGACTATT is 52.30°C. This method adjusts the Tm for salt concentration (50 mM Na+).

Nearest neighbor (NN) thermodynamics method

This method gives Tm based on nearest neighbor (NN) thermodynamics

For example, calculate the Tm for sequence `TAGCGATGACTGATCCATGACTATT”

# load package
from Bio.SeqUtils import MeltingTemp as mt

seq = "TAGCGATGACTGATCCATGACTATT"
tm = mt.Tm_NN(seq) 
print(tm)

# output
53.52

The Tm of the sequence TAGCGATGACTGATCCATGACTATT is 53.52°C.




This work is licensed under a Creative Commons Attribution 4.0 International License