R/clean_granges.R

Defines functions clean_granges

Documented in clean_granges

#' Clean GRanges object
#'
#' @keywords internal
#' @importFrom GenomicRanges elementMetadata
clean_granges <- function(gr) {
    no_no_cols <- c(
        "seqnames", "ranges", "strand", "seqlevels", "seqlengths",
        "isCircular", "start", "end", "width", "element"
    )
    metadat <- GenomicRanges::elementMetadata(gr)
    GenomicRanges::elementMetadata(gr) <-
        metadat[, !colnames(metadat) %in% no_no_cols]
    return(gr)
}
RajLabMSSM/echoannot documentation built on Oct. 26, 2023, 2:41 p.m.