R/subset_peaks.R

Defines functions subset_peaks

subset_peaks <- function(peaks,
                         query_granges,
                         verbose = TRUE){ 
    
    messager("Subsetting peaks.",v=verbose)
    GenomicRanges::mcols(peaks)$peakwidth <- GenomicRanges::width(peaks)
    subsetByOverlaps <- get(
        "subsetByOverlaps",
        asNamespace("GenomicRanges")
    )
    hits <- subsetByOverlaps(peaks, query_granges)
    return(hits)
}
neurogenomics/PeakyFinders documentation built on Oct. 14, 2024, 3:09 p.m.