MBAmethyl: Model-based analysis of DNA methylation data

Description Usage Arguments Value Author(s) References Examples

View source: R/MBAmethyl.R

Description

This function reconstructs DNA methylation values from raw measurements. It iteratively implements the group fused lars to smooth related-by-location methylation values and the constrained least squares to remove probe affinity effect across multiple sequences. It also contains a criterion-based method (AIC or BIC) for selecting the tuning paramter.

Usage

1
MBAmethyl(Y, wts = .defaultWeights(nrow(Y)), steps = min(dim(Y)) - 1)

Arguments

Y

An observed matrix (p x n) of methylation values (beta values); p is the number of probes and n is the number of samples;

wts

A pre-specified vector of weights. By default, we use the probe index-dependent weight scheme, $wts_i = sqrt(p / i / (p - i))$ for $i = 1, ... , p$;

steps

Limit the number of steps taken. One can use this option to perform early stopping.

Value

ans.aic

A list corresponds to the AIC, containing estimated beta values, estimated probed effects, estimated change-point locations, residual sum of squares, and degree of freedom.

ans.bic

A list corresponds to the BIC, containing estimated beta values, estimated probed effects, estimated change-point locations, residual sum of squares, and degree of freedom.

Author(s)

Tao Wang, Mengjie Chen

References

paper under review

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
  p <- 80
  n <- 40
  K <- 2
  k <- K - 1
  cp <- numeric()
  L <- c(0, floor(p / K) * (1 : k), p)
  cp <- floor(p / K) * (1 : k) + 1

  ## phi0: probe effects; theta0: true methylation values; part: partition of probe indices
  phi0 <- runif(p, 0.5, 2.0)
  theta0 <- matrix(0, p, n)
  part <- list()

  for (s in 1 : K) {
    part[[s]] <- (L[s] + 1) : L[s + 1]
    phi0[part[[s]]] <- phi0[part[[s]]] / sqrt(mean(phi0[part[[s]]]^2))
  }

  theta0[part[[1]], ] <- rep(1, length(part[[1]])) 
  theta0[part[[2]], ] <- rep(1, length(part[[2]])) 
  
  error <- matrix(runif(p * n, 0, 0.1), p, n)
  Y <- theta0 * phi0  + error
  fit <- MBAmethyl(Y, steps = 10)

Example output



MBAmethyl documentation built on Nov. 8, 2020, 5:33 p.m.