knitr::opts_chunk$set(echo = TRUE)

In this tutorial, we demonstrate how to call peaks on a single-cell ATAC-seq dataset using MACS2.

To use the peak calling functionality in Signac you will first need to install MACS2. This can be done using pip or conda, or by building the package from source.

In this demonstration we use scATAC-seq data for human PBMCs. See our vignette for the code used to generate this object, and links to the raw data. First, load the required packages and the pre-computed Seurat object:

library(Signac)
library(Seurat)

pbmc <- readRDS("../vignette_data/pbmc.rds")
DimPlot(pbmc)

Peak calling can be performed using the CallPeaks() function, and can either be done separately for different groups of cells, or performed using data from all the cells. To call peaks on each annotated cell type, we can use the group.by argument:

peaks <- CallPeaks(
  object = pbmc,
  group.by = "predicted.id"
)

The results are returned as a GRanges object, with an additional metadata column listing the cell types that each peak was identified in:

knitr::kable(head(as.data.frame(peaks)))

To quantify counts in each peak, you can use the FeatureMatrix() function.

We can visualize the cell-type-specific MACS2 peak calls alongside the 10x Cellranger peak calls (currently being used in the pbmc object) with the CoveragePlot() function. Here the Cellranger peaks are shown in grey and the MACS2 peaks in red:

CoveragePlot(
  object = pbmc,
  region = "CD8A",
  ranges = peaks,
  ranges.title = "MACS2"
)

Session Info

sessionInfo()



timoast/signac documentation built on April 5, 2024, 1:34 a.m.