R/XGR_parse_metadata.R

Defines functions XGR_parse_metadata

Documented in XGR_parse_metadata

#' XGR_parse_metadata
#'
#' @keywords internal
#' @family XGR
XGR_parse_metadata <- function(gr.lib,
                               lib.name = NA) {
    # https://stackoverflow.com/questions/50518137/separate-a-column-into-2-columns-at-the-last-underscore-in-r
    sep <- XGR_sep_handler(lib.name = lib.name)
    GenomicRanges::mcols(gr.lib) <-
        tidyr::separate(data.frame(GenomicRanges::mcols(gr.lib)),
            sep = sep,
            col = "fullname",
            into = c("Source", "Assay"),
            extra = "merge"
        )
    return(gr.lib)
}
RajLabMSSM/echoannot documentation built on Oct. 26, 2023, 2:41 p.m.