R/getDupMatBin.R

Defines functions getDupMatBin

Documented in getDupMatBin

#' Helper function used in \code{getBinDuplication} and
#'   \code{getBinRpkMean}
#'
#' \code{getDupMatBin} get a subset of the matrix for values in a specific bin
#' defined by the upper bound p and stepSize
#'
#' @param p The vector of bins
#' @param stepSize The window size
#' @param value The column to be subset
#' @param DupMat The duplication matrix calculated by \code{analyzeDuprates}
#' @return The subseted matrix
getDupMatBin <- function(p, stepSize=0.05, value="allCounts", DupMat) {
    ## subset of the matrix for values in a specific bin
    ## defined by the upper bound p and stepSize
    dupMatBin <- DupMat[DupMat[,value] <
                        quantile(DupMat[,value], p) &
                        DupMat[,value] >=
                        quantile(DupMat[,value], p - stepSize),]
    
    return(dupMatBin)
}

Try the dupRadar package in your browser

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

dupRadar documentation built on Nov. 8, 2020, 5:41 p.m.