filter_motifs: Filter a list of motifs.

View source: R/filter_motifs.R

filter_motifsR Documentation

Filter a list of motifs.

Description

Filter motifs based on the contents of available universalmotif slots. If the input motifs are not of universalmotif, then they will be converted for the duration of the filter_motifs() operation.

Usage

filter_motifs(motifs, name, altname, family, organism, width, alphabet, type,
  icscore, nsites, strand, pval, qval, eval, extrainfo)

Arguments

motifs

list See convert_motifs() for acceptable formats.

name

character Keep motifs by names.

altname

character Keep motifs by altnames.

family

character Keep motifs by family.

organism

character Keep motifs by organism.

width

numeric(1) Keep motifs with minimum width.

alphabet

character Keep motifs by alphabet.

type

character Keep motifs by type.

icscore

numeric(1) Keep motifs with minimum total IC.

nsites

numeric(1) Keep motifs with minimum number of target sites.

strand

character Keeps motifs by strand.

pval

numeric(1) Keep motifs by max P-value.

qval

numeric(1) Keep motifs by max Q-value.

eval

numeric(1) Keep motifs by max E-val.

extrainfo

character Named character vector of items that must be present in motif extrainfo slots.

Value

list Motifs. An attempt will be made to preserve the original class, see convert_motifs() for limitations.

Author(s)

Benjamin Jean-Marie Tremblay, benjamin.tremblay@uwaterloo.ca

Examples

## By minimum IC:
jaspar <- read_jaspar(system.file("extdata", "jaspar.txt",
                                  package = "universalmotif"))
jaspar.ic3 <- filter_motifs(jaspar, icscore = 3)

## Starting from version 1.10.0 of the universalmotif package, one
## could instead make use of the universalmotif_df structure:
jaspar.ic3 <- jaspar |> to_df() |> subset(icscore > 3) |> to_list()

## By organism:
## Not run: 
library(MotifDb)
motifs <- convert_motifs(MotifDb)
motifs <- filter_motifs(motifs, organism = c("Athaliana", "Mmusculus"),
                        extrainfo = c("dataSource" = "cisbp_1.02"))
## Or:
motifs <- convert_motifs(MotifDb) |> to_df() |>
  subset(organism %in% c("Athaliana", "Mmusculus") &
    dataSource == "cisbp_1.02") |> to_list()

## End(Not run)


bjmt/universalmotif documentation built on Nov. 16, 2024, 7:38 a.m.