Learn R Programming

TmCalculator

v1.1.0

Genome-wide nucleic acid melting temperature (Tm) profiling and multi-omics integration. Results are returned as GRanges objects, so Tm can be used directly as a quantitative genomic feature alongside ATAC-seq, RNA-seq, ChIP-seq and other assays.

1. install

install.packages("TmCalculator")

install dev version from github

pak::pkg_install("JunhuiLi1017/TmCalculator@dev")

2. usage and examples

Please see the vignetts for the details.

library(TmCalculator)

seqs <- to_genomic_ranges("AAAATTTTTTTCCCCCCCCCCCCCCGGGGGGGGGGGGTGTGCGCTGC")
tm_calculate(seqs, method = "tm_nn", nn_table = "DNA_NN_SantaLucia_2004", Na = 50)

3. thermodynamic parameter sets

Twenty-seven nearest-neighbor parameter sets are available, in two families.

Reference-salt sets were fitted at a single reference sodium concentration. Other conditions are reached through the salt_method correction formulas.

DuplexSets
DNA/DNADNA_NN_Breslauer_1986, DNA_NN_Sugimoto_1996, DNA_NN_Allawi_1998, DNA_NN_SantaLucia_2004 (default)
RNA/RNARNA_NN_Freier_1986, RNA_NN_Xia_1998, RNA_NN_Chen_2012
RNA/DNARNA_DNA_NN_Sugimoto_1995

Condition-specific sets were fitted directly at the sodium concentration shown, by melting-temperature optimization. They are intended to replace salt correction rather than be corrected. When the requested Na matches the concentration a set was fitted at, salt correction is skipped automatically; when it does not, the correction is applied with a warning.

DuplexSetsFitted at
DNA/DNADNA_NN_Weber_20151020 mM
DNA/DNADNA_NN_Weber_OW04_69 / _119 / _220 / _621 / _102069–1020 mM
RNA/RNARNA_NN_Weber_VIF_71 / _121 / _221 / _621 / _102171–1021 mM
RNA/RNARNA_NN_Weber_FIF_71 / _121 / _221 / _621 / _102171–1021 mM
RNA/DNARNA_DNA_NN_Weber_2019_FT, RNA_DNA_NN_Weber_2019_VH1000 mM
RNA/DNARNA_DNA_NN_Weber_2019_LS100 mM

For RNA, the VIF (variable initiation factors) sets gave better cross-validation than FIF. For RNA/DNA hybrids at high salt, ..._FT was the best-performing set in the source study.

# Fitted at 100 mM, so no salt correction is applied on top of it
res <- tm_calculate(seqs, method = "tm_nn",
                    nn_table = "RNA_DNA_NN_Weber_2019_LS", Na = 100)
res$options[["Salt correction applied"]]                    # FALSE
res$options[["Parameter set fitted at [Na+] (mM)"]]         # 100

Pick the set whose fitted salt is closest to your experimental condition rather than correcting a distant one. See ?tm_nn for the full list and citations.

4. launch an R shiny application

using R function TmCalculatorShiny::TmCalculator_shiny()

5. citation

If you use the melting-temperature-optimized parameter sets, please also cite the source studies:

Copy Link

Version

Install

install.packages('TmCalculator')

Monthly Downloads

928

Version

1.1.0

License

MIT + file LICENSE

Maintainer

Junhui Li

Last Published

September 14th, 2026

Functions in TmCalculator (1.1.0)

gc_content

Calculate G and C content of nucleotide sequences
.getseq_vectorized

Vectorized sequence extraction with getSeq
print.TmCalculator

Prints melting temperature from a TmCalculator object
s2c

convert a string into a vector of characters
make_genomiccoord

Generate sliding-window genomic coordinate strings for Tm calculation
integrate_granges

Integrate a Tm GRanges with multi-omic feature ranges
plot_tm

Compare Tm distributions across groups
plot_genome_track

Plot genome tracks in linear or circular layout
generate_complement

Generate complementary sequence
salt_correct

Corrections of melting temperature with salt concentration
thermodynamic_gc_params

Thermodynamic parameters for GC-based Tm calculation methods
to_genomic_ranges_fast

Convert input sequences to a GRanges object (fast backend)
tm_wallace

Calculate the melting temperature using the 'Wallace rule'
tm_nn

Calculate melting temperature using nearest neighbor thermodynamics
tm_gc

Calculate the melting temperature using empirical formulas based on GC content
vec_to_genomic_ranges

Convert sequence strings to GenomicRanges object
tm_calculate

Calculate melting temperature using multiple methods
thermodynamic_nn_params

Thermodynamic Tables for Nucleic Acid Hybridization
.find_N_bounds

Detect the first and last non-N positions on a chromosome
chem_correct

Corrections of melting temperature with chemical substances
compare_groups

Compare numeric GRanges metadata across groups
$.TmCalculator

Lazy $df accessor for TmCalculator objects
check_filter_seq

Filter invalid bases in nucleotide sequences
coor_to_genomic_ranges

Convert genomic coordinate strings to a GRanges object
complement_fast

Fast complement and reverse complement
.chem_correct_vec

Vectorized chemical correction over per-sequence GC percent
.get_bsgenome_from_pkg

Load the BSgenome object from an installed BSgenome.* data package
ecoli_rep_hotspots

E. coli K-12 MG1655 replication-associated hotspot annotations
.gc_vec

Vectorized GC percent over a character vector of sequences
fa_to_genomic_ranges

Convert FASTA file to GenomicRanges object
.filter_N_windows

Filter windows with too many N bases
.normalize_tm_gc_metadata

Normalize Tm/GC metadata column names on a GRanges object
.load_genome_packages

Load installed BSgenome packages
TmCalculator-package

TmCalculator: Genome-Wide Nucleic Acid Melting Temperature Profiling and Multi-Omics Integration
.getseq_preload_chr

Sequence extraction by preloading whole chromosomes
.salt_correct_vec

Vectorized salt correction over per-sequence GC percent and length
.parse_coord_strings

Parse coordinate strings into a data frame