Skip to contents
  • m2b() converts M-values to Beta-values.

  • b2m() converts Beta-values to M-values.

Usage

m2b(m, base = 2)

b2m(b, base = 2)

Arguments

m

A numeric vector of M-values.

base

The base with respect to which logarithms are computed. Defaults to base = 2.

b

A numeric vector of Beta-values.

References

Du, P. et al. Comparison of Beta-value and M-value methods for quantifying methylation levels by microarray analysis. BMC Bioinformatics 11, (2010). doi:10.1186/1471-2105-11-587 .

Examples

# M-values and Beta-values have different domains
m2b(c(-Inf, 0, Inf))
#> [1] 0.0 0.5 1.0
b2m(c(0, 0.5, 1))
#> [1] -Inf    0  Inf

# `m2b()` and `b2m()` are the inverse of one another
b2m(m2b(c(-Inf, 0, Inf)))
#> [1] -Inf    0  Inf

m2b(b2m(c(0, 0.5, 1)))
#> [1] 0.0 0.5 1.0