R/update.setup.R

update.setup <- function(setup, nperm, lambda, nthread){
  
  if(!is.null(nperm)){
    setup$options$nperm <- nperm
  }
  
  if(!is.null(nthread)){
    setup$options$nthread <- nthread
  }
  
  # hyper-threading is off. Convenient for NIH biowulf users
  # mightbe unnecessary for others
  setup$options$nthread <- min(setup$options$nthread, detectCores());
  
  if(is.null(lambda)){
    lambda <- 1.0
  }else{
    setup$options$lambda <- setup$options$lambda * lambda
    for(i in 1:length(setup$norm.stat$V)){
      setup$norm.stat$V[[i]] <- setup$norm.stat$V[[i]] / lambda
      setup$norm.stat$score0[[i]] <- setup$norm.stat$score0[[i]] / lambda
    }
  }
  
  tmp <- .C("check_nthread", nthread = as.integer(setup$options$nthread), PACKAGE = "ARTP2")
  setup$options$nthread <- tmp$nthread
  
  setup
  
  
}

Try the ARTP2 package in your browser

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

ARTP2 documentation built on May 2, 2019, 3:38 p.m.