R/collectStats.R

Defines functions collectStats

Documented in collectStats

#' collect various cross-correlation and window size stats for QC
#' 
#' @param curbam    the name of the BAM file to do this for 
#' @param pe.param  paired end parameters, derived elsewhere
#' 
#' @return          the output of csaw::profileSites after massaging inputs
#'
#' @import csaw
#' @import SummarizedExperiment
#'
#' @export
collectStats <- function(curbam, pe.param) { 
  wcnt <- windowCounts(curbam, spacing=50, width=50, param=pe.param, filter=20)
  rsums <- rowSums(assays(wcnt)$counts)
  maxed <- findMaxima(rowRanges(wcnt), range=1000, metric=rsums)
  rmax <- rowRanges(wcnt)[maxed]
  profileSites(curbam, rmax, param=pe.param)
}
biobenkj/ATACseeker documentation built on May 7, 2019, 8:36 a.m.