tm_wallace: Calculate the melting temperature using the 'Wallace rule'

View source: R/tm_wallace.R

tm_wallaceR Documentation

Calculate the melting temperature using the 'Wallace rule'

Description

The Wallace rule is often used as rule of thumb for approximate melting temperature calculations for primers with 14 to 20 nt length.

Usage

tm_wallace(gr_seq, ambiguous = FALSE)

Arguments

gr_seq

Sequence(s) in 5' to 3' direction, as the GRanges that to_genomic_ranges returns. A character vector of sequences, a path to a FASTA file, or genomic coordinate strings are also accepted and converted for you. To pair a sequence with a complement of your own, build the object explicitly: to_genomic_ranges(seq, complement_seq = cmp).

ambiguous

Ambiguous bases are taken into account to compute the G and C content when ambiguous is TRUE.

Value

Returns a list of sequences with updated Tm attributes

Length of validity

The 2 + 4 rule was calibrated on 14 to 20 nt hybridisation probes and carries no length-dependent, salt-dependent or concentration-dependent term. Its error therefore grows without bound as sequences lengthen, and on genome-scale windows it returns a number that is not a melting temperature in any useful sense: a 200 bp window is reported at several hundred degrees Celsius.

Sequences longer than 30 nt raise a warning that names tm_nn as the appropriate alternative. A warning rather than an error, because the rule stays a legitimate rule of thumb and users who knowingly apply it outside its calibrated range should not be blocked; wrap the call in suppressWarnings() in that case.

Author(s)

Junhui Li

References

Thein S L , Lynch J R , Weatherall D J , et al. DIRECT DETECTION OF HAEMOGLOBIN E WITH SYNTHETIC OLIGONUCLEOTIDES[J]. The Lancet, 1986, 327(8472):93.

Examples


input_seq = c('acgtTGCAATGCCGTAWSDBSY','acgtTGCCCCGGCCGCGCCGTAWSDBSY') #for wallace rule
gr_seq <- to_genomic_ranges(input_seq)
out <- tm_wallace(gr_seq, ambiguous = TRUE)
out
out$options


TmCalculator documentation built on Oct. 5, 2026, 5:08 p.m.