R/filter_percentiles.R

Defines functions filter_percentiles

filter_percentiles <- function(gr, 
                               thresh,
                               thresholding_cols){
    # message("Filtering percentiles.")
    for(nm in paste(thresholding_cols,"percentile",sep="_")){
        if(nm %in% names(GenomicRanges::mcols(gr))){
            gr <- gr[GenomicRanges::mcols(gr)[[nm]]>=thresh,]
        }
    }
    return(gr)
}
neurogenomics/EpiCompare documentation built on Oct. 18, 2024, 11:04 p.m.