R/count_func.R

Defines functions count_func

Documented in count_func

#' Helper function used to create count overlap type feature space
#'
#' @param binned_data_gr A GRanges object
#' @param annot_data_gr A Granges object
#'
#' @return A vector of counts enumerating the number of overlaps
#'
#' @import IRanges GenomicRanges
#'
count_func <- function(binned_data_gr, annot_data_gr) {

    # Finding the total number of overlaps between genomic bins and the specific
    # genomic annotation
    count_total <- countOverlaps(binned_data_gr, annot_data_gr)

    return(count_total)
}
stilianoudakis/preciseTAD documentation built on Sept. 23, 2021, 9:36 p.m.