R/add_mcol.R

Defines functions add_mcol

add_mcol <- function(gr,
                     name,
                     value,
                     verbose=FALSE){
    if(length(gr)==0){
        messager("WARNING: GRanges contains 0 rows.",v=verbose)
        return(gr)
    } else {
        GenomicRanges::mcols(gr)[[name]] <- value
        return(gr)
    } 
    return(gr)
}
neurogenomics/PeakyFinders documentation built on Oct. 14, 2024, 3:09 p.m.