knitr::opts_chunk$set(echo = TRUE) knitr::opts_knit$set(root.dir = "../vignette_data/bmmc")
library(Signac) library(Seurat)
For this vignette we'll use the dataset introduced and pre-processed in the trajectory building vignette.
bone <- readRDS("cd34.rds") DimPlot(bone, label = TRUE)
To perform a footprinting analysis we first need to add motif information to the object, including the exact positions of each motif. This can be done using functions from the \code{motifmatchr} and \code{TFBSTools} packages.
if (!requireNamespace("JASPAR2020", quietly = TRUE)) BiocManager::install("JASPAR2020") if (!requireNamespace("TFBSTools", quietly = TRUE)) BiocManager::install("TFBSTools") if (!requireNamespace("motifmatchr", quietly = TRUE)) BiocManager::install("motifmatchr") if (!requireNamespace("BSgenome.Hsapiens.UCSC.hg19", quietly = TRUE)) BiocManager::install("BSgenome.Hsapiens.UCSC.hg19")
library(motifmatchr) library(JASPAR2020) library(TFBSTools) library(BSgenome.Hsapiens.UCSC.hg19) # extract position frequency matrices for the motifs pwm <- getMatrixSet( x = JASPAR2020, opts = list(species = 9606, all_versions = FALSE) ) # add motif information bone <- AddMotifs(bone, genome = BSgenome.Hsapiens.UCSC.hg19, pfm = pwm)
Now we can footprint any motif that we have positional information for. By
default, this includes every instance of the motif in the genome. We can instead
use the in.peaks = TRUE
parameter to include only those motifs that fall
inside a peak in the assay. The Footprint()
function gathers all the required
data and stores it in the assay. We can then plot the footprinted motifs using
the PlotFootprint()
function.
# gather the footprinting information for sets of motifs bone <- Footprint( object = bone, motif.name = c("GATA2", "CEBPA", "EBF1"), genome = BSgenome.Hsapiens.UCSC.hg19 ) # plot the footprint data for each group of cells p2 <- PlotFootprint(bone, features = c("GATA2", "CEBPA", "EBF1"))
p2 + patchwork::plot_layout(ncol = 1)
Session Info
sessionInfo()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.