R/get.bam.chrs.R

Defines functions .get.bam.chrs

# get bam info
.get.bam.chrs<- function(file){
  
  # index
  if (! file.exists(paste(file,'.bai',sep=""))) {
    print(paste("Stage: index bam file", file))
    date()
    indexBam(file)
  }
  
  param <- ScanBamParam(what="rname")
  bam <- scanBam(file, param=param)
  chr=levels(bam[[1]]$rname)
  
  # save result
  return(chr)
  
}

Try the exomePeak package in your browser

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

exomePeak documentation built on May 6, 2019, 2:05 a.m.