# Calculate Melting Temperature (Tm) in R

Renesh Bedre, Shreya Udawant    2 minute read

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

In R, the Tm can be calculated using the `TmCalculator` package. This package has different methods for Tm calculation based on the sequence content, salt concentration, and thermodynamics parameters.

The following examples explain how to use the `TmCalculator` 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
library(TmCalculator)

seq = "TAGCGATGAATCC"
Tm_Wallace(seq)

# output
38.0
``````

The Tm of the sequence `TAGCGATGAATCC` is 38.0°C

If the input sequence contains ambiguous nucleotides, then you should use the `ambiguous = TRUE` option to `Tm_Wallace()`.

For example, calculate the Tm for sequence `TAGCGATGAARTCCS`

``````# load package
library(TmCalculator)

seq = "TAGCGATGAARTCCS"
Tm_Wallace(seq, ambiguous = TRUE)

# output
44.85
``````

The Tm of the sequence `TAGCGATGAARTCCS` is 44.85°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
library(TmCalculator)

seq = "TAGCGATGACTGATCCATGACTATT"
Tm_GC(seq, variant = "Primer3Plus", Na = 50)

# output
52.30
``````

The Tm of the sequence `TAGCGATGACTGATCCATGACTATT` is 52.30°C. This method adjusts the Tm for salt concentration (50 mM Na+). In addition to Na, you can also adjust the concentration of other ions (e.g. K, Mg).

If the input sequence contains ambiguous nucleotides, then you should use the `ambiguous = TRUE` option to `Tm_GC()`.

For example, calculate the Tm for sequence `TAGCGARTGACTGATCCATGACTATST`

``````# load package
library(TmCalculator)

seq = "TAGCGARTGACTGATCCATGACTATST"
Tm_GC(seq, variant = "Primer3Plus", Na = 50, ambiguous = TRUE)

# output
55.01
``````

The Tm of the sequence `TAGCGATGACTGATCCATGACTATT` is 55.01°C.

## 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
library(TmCalculator)

seq = "TAGCGATGACTGATCCATGACTATT"
Tm_NN(seq, Na = 50)

# output
49.11
``````

The Tm of the sequence `TAGCGATGACTGATCCATGACTATT` is 49.11°C.

If the input sequence contains ambiguous nucleotides, then you should use the `ambiguous = TRUE` option to `Tm_NN()`.

For example, calculate the Tm for sequence `TAGRCGATGACTGARTCBCCCATGACTASTT”

``````# load package
library(TmCalculator)

seq = "TAGRCGATGACTGARTCBCCCATGACTASTT"
Tm_NN(seq, Na = 50, ambiguous = TRUE)

# output
54.09
``````

The Tm of the sequence `TAGRCGATGACTGARTCBCCCATGACTASTT` is 54.09°C.

## Subscribe to get new article to your email when published

* indicates required