R/FilteringFunctions.R

Defines functions .filterWithPoisson

################################################################################################
.filterWithPoisson <- function(data, coverageDepth, genomeSize, pVal) {
  # calculate lambda value (average)
  lambda <- coverageDepth / (genomeSize * 2)
  # get cutoff value
  cutoff <- qpois(pVal, lambda, lower.tail=FALSE, log.p=FALSE)
  # fiter tss table
  data[data<cutoff,] =0
  return(data)
}
Linlab-slu/TSSr documentation built on Oct. 24, 2023, 8:32 p.m.