View source: R/preprocessing.R
CreateMotifMatrix | R Documentation |
Create a motif x feature matrix from a set of genomic ranges, the genome, and a set of position weight matrices.
CreateMotifMatrix(
features,
pwm,
genome,
score = FALSE,
use.counts = FALSE,
sep = c("-", "-"),
...
)
features |
A GRanges object containing a set of genomic features |
pwm |
A |
genome |
Any object compatible with the |
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 |
sep |
A length-2 character vector containing the separators to be used when constructing matrix rownames from the GRanges |
... |
Additional arguments passed to
|
Requires that motifmatchr is installed https://www.bioconductor.org/packages/motifmatchr/.
Returns a sparse matrix
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.