R/MOTIFBREAKR_filter_by_metadata.R

Defines functions MOTIFBREAKR_filter_by_metadata

Documented in MOTIFBREAKR_filter_by_metadata

#' Filter \pkg{motifbreakR} results
#' 
#' Filter by motif database metadata.
#' @inheritParams MOTIFBREAKR
#' @inheritParams MOTIFBREAKR_filter
#' @family motifbreakR
#' @keywords internal
#' @importFrom GenomicRanges mcols
#' @importFrom BiocGenerics %in%
MOTIFBREAKR_filter_by_metadata <- function(mb_res,
                                           Organism="Hsapiens"){
    requireNamespace("MotifDb")
    organism <- providerId <- NULL;
    meta <- subset(GenomicRanges::mcols(MotifDb::MotifDb), organism==Organism)
    mb.filtered <-subset(mb_res, providerId %in% meta$providerId)
    return(mb.filtered)
}
RajLabMSSM/echoannot documentation built on Oct. 26, 2023, 2:41 p.m.