Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

CreateMotifMatrix

Create motif matrix


Description

Create a motif x feature matrix from a set of genomic ranges, the genome, and a set of position weight matrices.

Usage

CreateMotifMatrix(
  features,
  pwm,
  genome,
  score = FALSE,
  use.counts = FALSE,
  sep = c("-", "-"),
  ...
)

Arguments

features

A GRanges object containing a set of genomic features

pwm

A PFMatrixList or PWMatrixList object containing position weight/frequency matrices to use

genome

Any object compatible with the genome argument in matchMotifs

score

Record the motif match score, rather than presence/absence (default FALSE)

use.counts

Record motif counts per region. If FALSE (default), record presence/absence of motif. Only applicable if score=FALSE.

sep

A length-2 character vector containing the separators to be used when constructing matrix rownames from the GRanges

...

Additional arguments passed to matchMotifs

Details

Requires that motifmatchr is installed https://www.bioconductor.org/packages/motifmatchr/.

Value

Returns a sparse matrix

Examples

## Not run: 
library(JASPAR2018)
library(TFBSTools)
library(BSgenome.Hsapiens.UCSC.hg19)

pwm <- getMatrixSet(
  x = JASPAR2018,
  opts = list(species = 9606, all_versions = FALSE)
)
motif.matrix <- CreateMotifMatrix(
  features = granges(atac_small),
  pwm = pwm,
  genome = BSgenome.Hsapiens.UCSC.hg19
)

## End(Not run)

Signac

Analysis of Single-Cell Chromatin Data

v1.2.1
MIT + file LICENSE
Authors
Tim Stuart [aut, cre] (<https://orcid.org/0000-0002-3044-0897>), Avi Srivastava [aut] (<https://orcid.org/0000-0001-9798-2079>), Paul Hoffman [ctb] (<https://orcid.org/0000-0002-7693-8957>), Rahul Satija [ctb] (<https://orcid.org/0000-0001-9448-8833>)
Initial release
2021-05-11

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.