R/pick.chr.arm.R

Defines functions pick.chr.arm

pick.chr.arm <- function(X, chr, arm = NULL){

  if (chr == 'X') { chr <- 23 }
  if (chr == 'Y') { chr <- 24 }

  if (!is.null(arm)){
    # pick probes for this arm
    indices <- which(X$info$chr == as.numeric(chr) & X$info$arm == arm)
  } else {
    #pick probes for whole chromosome
    warning("arm information not given, modeling the whole chromosome")
    indices <- which(X$info$chr == as.numeric(chr))  
  }

  chrarmX <- list(data = X$data[indices,,drop=FALSE],
                  info = X$info[indices,])

  chrarmX
}

Try the pint package in your browser

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

pint documentation built on Oct. 31, 2019, 2:41 a.m.