R/fitParallel.R

Defines functions fitParallel

Documented in fitParallel

fitParallel <- function(chr, object, consec, conseclambda, lambda, C){
  message(paste("Fitting ", chr, "...", sep = ""))
  chrIndex <- object$CHR %in% chr
  chromosome <- object[chrIndex,]
  if (consec) 
  {
    stopifnot(conseclambda >= 1)
    lambda <- conseclambda
    pos <- seq_along(chromosome$pos)
  }
  else 
  {
    pos <- chromosome$pos
  }
  sigma = lambda/C
  lag = lambda
  beta <- chromosome$weights
  df <- 1
  X2 <- beta^2
  pvalue <- KernelTest(pos = pos, X2 = X2, lambda = sigma, df = df)
  chromosome$raw <- pvalue
  chromosome
}

Try the DMRcate package in your browser

Any scripts or data that you put into this service are public.

DMRcate documentation built on Jan. 17, 2021, 2 a.m.