filter_motifs {spatzie} | R Documentation

## Filter motifs based on occurrence within interaction data

### Description

Select a subset of motifs that are in at least a threshold fraction of regions. Motif subsets are selected separately for anchor one and anchor two regions.

### Usage

    filter_motifs(interaction_data, threshold)

### Arguments

`interaction_data` | an interactionData object of paired genomic regions
`threshold` | fraction of interactions that should contain a motif for a motif to be considered

### Value

an interactionData object where `obj$anchor1_motif_indices` and `obj$anchor2_motif_indices` have been filtered to motifs that are present in a threshold fraction of interactions

### Author(s)

Jennifer Hammelman

### Examples

    ## Not run:
    genome_id <- "BSgenome.Mmusculus.UCSC.mm9"
    if (!(genome_id %in% rownames(utils::installed.packages()))) {
      BiocManager::install(genome_id, update = FALSE, ask = FALSE)
    }
    genome <- BSgenome::getBSgenome(genome_id)

    motifs_file <- system.file("extdata/motifs_subset.txt.gz",
                               package = "spatzie")
    motifs <- TFBSTools::readJASPARMatrix(motifs_file, matrixClass = "PFM")

    yy1_pd_interaction <- scan_motifs(spatzie::interactions_yy1, motifs, genome)
    yy1_pd_interaction <- filter_motifs(yy1_pd_interaction, 0.4)

    ## End(Not run)

    res <- filter_motifs(spatzie::scan_interactions_example, threshold = 0.1)

[Package spatzie version 1.0.1 Index]