m2b: Convert M-values to Beta-values and back again

View source: R/m2b.R

m2bR Documentation

Convert M-values to Beta-values and back again

Description

  • 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))
b2m(c(0, 0.5, 1))

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

m2b(b2m(c(0, 0.5, 1)))


maialab/daeqtlr documentation built on May 18, 2022, 6:53 a.m.