For this tutorial, we will be analyzing a single-cell ATAC-seq dataset of human peripheral blood mononuclear cells (PBMCs) provided by 10x Genomics. The following files are used in this vignette, all available through the 10x Genomics website:

First load in Signac, Seurat, and some other packages we will be using for analyzing human data.



The vignette below presents a detailed workflow for the pre-processing, QC, clustering, visualization, integration, and interpretation of single-cell ATAC-seq data. While there are many steps (some of which are computationally intensive), we note that the core analytical components are similar to single-cell RNA-seq, and can be run quickly in a few lines. For example, the following lines encapsulate our scATAC-seq workflow (but does not include the calculation of advanced QC metrics, or integration with scRNA-seq data).


counts <- Read10X_h5(filename = "/home/stuartt/github/chrom/vignette_data/atac_v1_pbmc_10k_filtered_peak_bc_matrix.h5")
metadata <- read.csv(
  file = "/home/stuartt/github/chrom/vignette_data/atac_v1_pbmc_10k_singlecell.csv",
  header = TRUE,
  row.names = 1

pbmc_fast <- CreateSeuratObject(counts = counts, = metadata) %>%
  subset(peak_region_fragments > 1000) %>%
  RunTFIDF() %>%
  FindTopFeatures(cutoff = 'q75') %>%
  RunSVD('lsi') %>%
  FindNeighbors(reduction='lsi', dims=1:30) %>%
  FindClusters(resolution = 0.5,verbose = FALSE) %>%
  RunUMAP(reduction='lsi', dims=1:30)

DimPlot(pbmc_fast, label = FALSE)

Below, we describe these steps in detail, beginning with pre-processing.

Pre-processing workflow

When pre-processing chromatin data, Signac uses information from two related input files, both of which are created by CellRanger:

  • Peak/Cell matrix. This is analogous to the gene expression count matrix used to analyze single-cell RNA-seq. However, instead of genes, each row of the matrix represents a region of the genome (a ‘peak’), that is predicted to represent a region of open chromatin. Each value in the matrix represents the number of Tn5 cut sites for each single barcode (i.e. cell) that map within each peak. You can find more detail on the 10X Website.

  • Fragment file. This represents a full list of all unique fragments across all single cells. It is a substantially larger file, is slower to work with, and is stored on-disk (instead of in memory). However, the advantage of retaining this file is that it contains all fragments associated with each single cell, as opposed to only reads that map to peaks.

For most analyses we work with the peak/cell matrix, but for some (e.g. creating a ‘Gene Activity Matrix’), we find that restricting only to reads in peaks can adversely affect results. We therefore use both files in this vignette. We start by creating a Seurat object using the peak/cell matrix, and store the path to the fragment file on disk in the Seurat object:

counts <- Read10X_h5(filename = "/home/stuartt/github/chrom/vignette_data/atac_v1_pbmc_10k_filtered_peak_bc_matrix.h5")
metadata <- read.csv(
  file = "/home/stuartt/github/chrom/vignette_data/atac_v1_pbmc_10k_singlecell.csv",
  header = TRUE,
  row.names = 1

pbmc <- CreateSeuratObject(
  counts = counts,
  assay = 'peaks',
  project = 'ATAC',
  min.cells = 1, = metadata
## Warning in CreateSeuratObject(counts = counts, assay = "peaks", project =
## "ATAC", : Some cells in not present in provided counts matrix.
fragment.path <- '/home/stuartt/github/chrom/vignette_data/atac_v1_pbmc_10k_fragments.tsv.gz'

pbmc <- SetFragments(
  object = pbmc,
  file = fragment.path
## An object of class Seurat 
## 89307 features across 8728 samples within 1 assay 
## Active assay: peaks (89307 features)

Optional step: Filtering the fragment file

To make downstream steps that use this file faster, we can filter the fragments file to contain only reads from cells that we retain in the analysis. This is optional, but slow, and only needs to be performed once. Running this command writes a new file to disk and indexes the file so it is ready to be used by Signac.

fragment_file_filtered <- "/home/stuartt/github/chrom/vignette_data/atac_v1_pbmc_10k_filtered_fragments.tsv"
  fragment.path = fragment.path,
  cells = colnames(pbmc),
  output.path = fragment_file_filtered
pbmc <- SetFragments(object = pbmc, file = paste0(fragment_file_filtered, '.bgz'))

Computing QC Metrics

We can now compute some QC metrics for the scATAC-seq experiment. We currently suggest the following metrics below to assess data quality. As with scRNA-seq, the expected range of values for these parameters will vary depending on your biological system, cell viability, etc.

  • Nucleosome banding pattern: The histogram of fragment sizes (determined from the paired-end sequencing reads) should exhibit a strong nucleosome banding pattern. We calculate this per single cell, and quantify the approximate ratio of mononucleosomal to nucleosome-free fragments (stored as nucleosome_signal). Note that by default, this is calculated only on chr1 reads (see the region parameter) to save time.

  • Transcriptional start site (TSS) enrichment score. The ENCODE project has defined an ATAC-seq targeting score based on the ratio of fragments centered at the TSS to fragments in TSS-flanking regions (see Poor ATAC-seq experiments typically will have a low TSS enrichment score. We can compute this metric for each cell with the TSSEnrichment function, and the results are stored in metadata under the column name TSS.enrichment.

  • Total number of fragments in peaks: A measure of cellular sequencing depth / complexity. Cells with very few reads may need to be excluded due to low sequencing depth. Cells with extremely high levels may represent doublets or nuclear clumps.

  • Fraction of fragments in peaks. Represents the fraction of total fragments that fall within ATAC-seq peaks. Cells with low values (i.e. <15-20%) often represent low-quality cells or technical artifacts that should be removed.

  • Ratio reads in ‘blacklist’ sites. The ENCODE project has provided a list of blacklist regions, representing reads which are often associated with artifactual signal. Cells with a high proportion of reads mapping to these areas (compared to reads mapping to peaks) often represent technical artifacts and should be removed. ENCODE blacklist regions for human (hg19 and GRCh38), mouse (mm10), Drosophila (dm3), and C. elegans (ce10) are included in the Signac package.

Note that the last three metrics can be obtained from the output of CellRanger (which is stored in the object metadata), but can also be calculated for non-10x datasets using Signac (more information at the end of this document).

pbmc <- NucleosomeSignal(object = pbmc)
pbmc$pct_reads_in_peaks <- pbmc$peak_region_fragments / pbmc$passed_filters * 100
pbmc$blacklist_ratio <- pbmc$blacklist_region_fragments / pbmc$peak_region_fragments

  object = pbmc,
  features = c('pct_reads_in_peaks', 'blacklist_ratio', 'nucleosome_signal', 'peak_region_fragments'),
  pt.size = 0.1,
  ncol = 4) + NoLegend()

We can also look at the fragment length periodicity for all the cells, and group by cells with high or low nucleosomal signal strength. You can see that cells which are outliers for the mononucleosomal/ nucleosome-free ratio (based off the plots above) have different banding patterns. The remaining cells exhibit a pattern that is typical for a successful ATAC-seq experiment.

pbmc$nucleosome_group <- ifelse(pbmc$nucleosome_signal > 10, 'NS > 10', 'NS < 10')
FragmentHistogram(object = pbmc, = 'nucleosome_group')

The enrichment of Tn5 integration events at transcriptional start sites (TSSs) can also be an important quality control metric to assess the targeting of Tn5 in ATAC-seq experiments. The ENCODE consortium defined a TSS enrichment score as the number of Tn5 integration site around the TSS normalized to the number of Tn5 integration sites in flanking regions. See the ENCODE documentation for more information about the TSS enrichment score ( We can calculate the TSS enrichment score for each cell using the TSSEnrichment function in Signac.

# create granges object with TSS positions
gene.ranges <- genes(EnsDb.Hsapiens.v75)
gene.ranges <- gene.ranges[gene.ranges$gene_biotype == 'protein_coding', ]

tss.ranges <- GRanges(
  seqnames = seqnames(gene.ranges),
  ranges = IRanges(start = start(gene.ranges), width = 2),
  strand = strand(gene.ranges)

seqlevelsStyle(tss.ranges) <- 'UCSC'
tss.ranges <- keepStandardChromosomes(tss.ranges, pruning.mode = 'coarse')

# to save time use the first 2000 TSSs
pbmc <- TSSEnrichment(object = pbmc, tss.positions = tss.ranges[1:2000])
pbmc$high.tss <- ifelse(pbmc$TSS.enrichment > 2, 'High', 'Low')
TSSPlot(pbmc, = 'high.tss') + ggtitle("TSS enrichment score") + NoLegend()

Finally we remove cells that are outliers for these QC metrics.

pbmc <- subset(pbmc, subset = peak_region_fragments > 1000 & peak_region_fragments < 20000 & pct_reads_in_peaks > 15 & blacklist_ratio < 0.05 & nucleosome_signal < 10 & TSS.enrichment > 2)
## An object of class Seurat 
## 89307 features across 7827 samples within 1 assay 
## Active assay: peaks (89307 features)

Normalization and linear dimensional reduction

  • Normalization: Signac performs term frequency-inverse document frequency (TF-IDF) normalization. This is a two-step normalization procedure, that both normalizes across cells to correct for differences in cellular sequencing depth, and across peaks to give higher values to more rare peaks.

  • Feature selection: The largely binary nature of scATAC-seq data makes it challenging to perform ‘variable’ feature selection, as we do for scRNA-seq. Instead, we can choose to use only the top n% of features (peaks) for dimensional reduction, or remove features present in less that n cells with the FindTopFeatures function. Here, we will all features, though we note that we see very similar results when using only a subset of features (try setting min.cutoff to ‘q75’ to use the top 25% all peaks), with faster runtimes. Features used for dimensional reduction are automatically set as VariableFeatures for the Seurat object by this function.

  • Dimensional reduction: We next run a singular value decomposition (SVD) on the TD-IDF normalized matrix, using the features (peaks) selected above. This returns a low-dimensional representation of the object (for users who are more familiar with scRNA-seq, you can think of this as analogous to the output of PCA).

pbmc <- RunTFIDF(pbmc)
pbmc <- FindTopFeatures(pbmc, min.cutoff = 'q0')
pbmc <- RunSVD(
  object = pbmc,
  assay = 'peaks',
  reduction.key = 'LSI_', = 'lsi'

Non-linear dimension reduction and clustering

Now that the cells are embedded in a low-dimensional space, we can use methods commonly applied for the analysis of scRNA-seq data to perform graph-based clustering, and non-linear dimension reduction for visualization. The functions RunUMAP, FindNeighbors, and FindClusters all come from the Seurat package.

pbmc <- RunUMAP(object = pbmc, reduction = 'lsi', dims = 1:30)
pbmc <- FindNeighbors(object = pbmc, reduction = 'lsi', dims = 1:30)
pbmc <- FindClusters(object = pbmc, verbose = FALSE)
DimPlot(object = pbmc, label = TRUE) + NoLegend()

Create a gene activity matrix

The UMAP visualization reveals the presence of multiple cell groups in human blood. If you are familiar with our scRNA-seq analyses of PBMC, you may even recognize the presence of certain myeloid and lymphoid populations in the scATAC-seq data. However, annotating and interpreting clusters is more challenging in scATAC-seq data, as much less is known about the functional roles of noncoding genomic regions than is known about protein coding regions (genes).

However, we can try to quantify the activity of each gene in the genome by assessing the chromatin accessibility associated with each gene, and create a new gene activity assay derived from the scATAC-seq data. Here we will use a simple approach of summing the reads intersecting the gene body and promoter region (we also recommend exploring the Cicero tool, which can accomplish a similar goal).

To create a gene activity matrix, we extract gene coordinates for the human genome from EnsembleDB, and extend them to include the 2kb upstream region (as promoter accessibility is often correlated with gene expression). We then count the number of fragments for each cell that map to each of these regions, using the using the FeatureMatrix function. This takes any set of genomic coordinates, counts the number of reads intersecting these coordinates in each cell, and returns a sparse matrix.

# extract gene coordinates from Ensembl, and ensure name formatting is consistent with Seurat object 
gene.coords <- genes(EnsDb.Hsapiens.v75, filter = ~ gene_biotype == "protein_coding")
seqlevelsStyle(gene.coords) <- 'UCSC'
genebody.coords <- keepStandardChromosomes(gene.coords, pruning.mode = 'coarse')
genebodyandpromoter.coords <- Extend(x = gene.coords, upstream = 2000, downstream = 0)

# create a gene by cell matrix
gene.activities <- FeatureMatrix(
  fragments = fragment.path,
  features = genebodyandpromoter.coords,
  cells = colnames(pbmc),
  chunk = 20

# convert rownames from chromsomal coordinates into gene names
gene.key <- genebodyandpromoter.coords$gene_name
names(gene.key) <- GRangesToString(grange = genebodyandpromoter.coords)
rownames(gene.activities) <- gene.key[rownames(gene.activities)]
# add the gene activity matrix to the Seurat object as a new assay, and normalize it
pbmc[['RNA']] <- CreateAssayObject(counts = gene.activities)
pbmc <- NormalizeData(
  object = pbmc,
  assay = 'RNA',
  normalization.method = 'LogNormalize',
  scale.factor = median(pbmc$nCount_RNA)

Now, we can visualize the ‘activities’ of canonical marker genes to help interpret our ATAC-seq clusters. Note that the activities will be much noisier than scRNA-seq measurements. This is because they represent predictions from sparse chromatin data, but also because they assume a general correspondence between gene body/promoter accessibility and expression, which may not always be the case. Nonetheless, we can begin to discern populations of monocytes, B, T, and NK cells. However, further subdivision of these cell types is challenging based on supervised analysis alone.

DefaultAssay(pbmc) <- 'RNA'

  object = pbmc,
  features = c('MS4A1', 'CD3D', 'LEF1', 'NKG7', 'TREM1', 'LYZ'),
  pt.size = 0.1,
  max.cutoff = 'q95',
  ncol = 3

Integrating with scRNA-seq data

To help interpret the scATAC-seq data, we can classify cells based on an scRNA-seq experiment from the same biological system (human PBMC). We utilize methods for cross-modality integration and label transfer, described here, with a more in-depth tutorial here. We aim to identify shared correlation patterns in the gene activity matrix and scRNA-seq dataset in order to identify matched biological states across the two modalities. This procedure returns a classification score for each cell, based on each scRNA-seq defined cluster label. Here we load a pre-processed scRNA-seq dataset for human PBMCs, also provided by 10x Genomics. You can download the raw data for this experiment from the 10x website, and view the code used to construct this object on GitHub. Alternatively, you can download the pre-processed Seurat object here.

# Load the pre-processed scRNA-seq data for PBMCs
pbmc_rna <- readRDS("/home/stuartt/github/chrom/vignette_data/pbmc_10k_v3.rds")

transfer.anchors <- FindTransferAnchors(
  reference = pbmc_rna,
  query = pbmc,
  reduction = 'cca'

predicted.labels <- TransferData(
  anchorset = transfer.anchors,
  refdata = pbmc_rna$celltype,
  weight.reduction = pbmc[['lsi']]

pbmc <- AddMetaData(object = pbmc, metadata = predicted.labels)
plot1 <- DimPlot(
  object = pbmc_rna, = 'celltype',
  label = TRUE,
  repel = TRUE) + NoLegend() + ggtitle('scRNA-seq')

plot2 <- DimPlot(
  object = pbmc, = '',
  label = TRUE,
  repel = TRUE) + NoLegend() + ggtitle('scATAC-seq')

CombinePlots(list(plot1,plot2), ncol = 2)

You can see that the RNA-based classifications are entirely consistent with the UMAP visualization, computed only on the ATAC-seq data. We can now easily annotate our scATAC-seq derived clusters (alternately, we could use the RNA classifications themselves). We note that cluster 16 maps to CD14+ Monocytes, but is a very small cluster with lower QC metrics. As this group is likely representing low-quality cells, we remove it from downstream analysis.

pbmc <- subset(pbmc,idents = 16, invert = TRUE)
pbmc <- RenameIdents(
  object = pbmc,
  '0' = 'CD14 Mono',
  '1' = 'CD4 Memory',
  '2' = 'CD14 Mono',
  '3' = 'CD8 Naive',
  '4' = 'CD8 Effector',
  '5' = 'DN T',
  '6' = 'CD4 Naive',
  '7' = 'NK CD56Dim',
  '8' = 'pre-B', 
  '9' = 'CD4 Naive',
  '10' = 'CD16 Mono',
  '11' = 'pro-B',
  '12' = 'CD8 Effector',
  '13' = 'DC',
  '14' = 'NK CD56bright',
  '15' = 'pDC'

Find differentially accessible peaks between clusters

To find differentially accessible regions between clusters of cells, we can perform a differential accessibility (DA) test. We utilize logistic regression for DA, as suggested by Ntranos et al. 2018 for scRNA-seq data, and add the total number of fragments as a latent variable to mitigate the effect of differential sequencing depth on the result. Here we will focus on comparing Naive CD4 cells and CD14 monocytes, but any groups of cells can be compared using these methods. We can also visualize these chromatin ‘markers’ on a violin plot, feature plot, dot plot, heat map, or any visualization tool in Seurat.

# switch back to working with peaks instead of gene activities
DefaultAssay(pbmc) <- 'peaks'

da_peaks <- FindMarkers(
  object = pbmc,
  ident.1 = "CD4 Naive",
  ident.2 = "CD14 Mono",
  min.pct = 0.2,
  test.use = 'LR',
  latent.vars = 'peak_region_fragments'

##                                  p_val  avg_logFC pct.1 pct.2     p_val_adj
## chr14:99721608-99741934  1.248988e-298  0.8451312 0.855 0.032 1.115434e-293
## chr14:99695477-99720910  5.684617e-244  0.8480430 0.800 0.033 5.076761e-239
## chr17:80084198-80086094  1.539486e-233  1.1634134 0.674 0.011 1.374869e-228
## chr7:142501666-142511108 3.526785e-220  0.7234070 0.747 0.039 3.149666e-215
## chr2:113581628-113594911 1.431566e-214 -0.9372776 0.040 0.666 1.278488e-209
## chr6:44025105-44028184   4.278056e-210 -0.9278800 0.045 0.622 3.820603e-205
plot1 <- VlnPlot(
  object = pbmc,
  features = rownames(da_peaks)[1],
  ncol = 3,
  pt.size = 0.1,
  idents = c("CD4 Memory","CD14 Mono")
plot2 <- FeaturePlot(
  object = pbmc,
  features = rownames(da_peaks)[1],
  ncol = 3,
  pt.size = 0.1

Peak coordinates can be difficult to interpret alone. We can find the closest gene to each of these peaks using the ClosestFeature function and providing an EnsDb annotation. If you explore the gene lists, you will see that peaks open in Naive T cells are close to genes such as BCL11B and GATA3 (key regulator of T cell differentiation), while peaks open in monocytes are close to genes such as CEBPB (key regulator of monocyte differentiation). We could follow up this result further by doing gene ontology enrichment analysis on the gene sets returned by ClosestFeature, and there are many R packages that can do this (see the GOstats package for example).

open_cd4naive <- rownames(da_peaks[da_peaks$avg_logFC > 0.5, ])
open_cd14mono <- rownames(da_peaks[da_peaks$avg_logFC < -0.5, ])

closest_genes_cd4naive <- ClosestFeature(
  regions = open_cd4naive, 
  annotation = EnsDb.Hsapiens.v75,
  sep = c(':', '-')
closest_genes_cd14mono <- ClosestFeature(
  regions = open_cd14mono,
  annotation = EnsDb.Hsapiens.v75,
  sep = c(':', '-')
##                           gene_id   gene_name   gene_biotype seq_coord_system
## ENSG00000127152   ENSG00000127152      BCL11B protein_coding       chromosome
## ENSG00000127152.1 ENSG00000127152      BCL11B protein_coding       chromosome
## ENSG00000176155   ENSG00000176155      CCDC57 protein_coding       chromosome
## ENSG00000204983   ENSG00000204983       PRSS1 protein_coding       chromosome
## ENSG00000259003   ENSG00000259003 AE000662.92 protein_coding       chromosome
## ENSG00000134709   ENSG00000134709       HOOK1 protein_coding       chromosome
##                        symbol   entrezid           closest_region
## ENSG00000127152        BCL11B      64919  chr14:99635624-99737861
## ENSG00000127152.1      BCL11B      64919  chr14:99635624-99737861
## ENSG00000176155        CCDC57     284001  chr17:80059336-80170706
## ENSG00000204983         PRSS1 5645, 5644 chr7:142457319-142460923
## ENSG00000259003   AE000662.92         NA  chr14:23025534-23027939
## ENSG00000134709         HOOK1      51361   chr1:60280458-60342050
##                               query_region distance
## ENSG00000127152    chr14:99721608-99741934        0
## ENSG00000127152.1  chr14:99695477-99720910        0
## ENSG00000176155    chr17:80084198-80086094        0
## ENSG00000204983   chr7:142501666-142511108    40742
## ENSG00000259003    chr14:23012859-23028219        0
## ENSG00000134709     chr1:60279767-60281364        0
##                         gene_id    gene_name   gene_biotype seq_coord_system
## ENSG00000125538 ENSG00000125538         IL1B protein_coding       chromosome
## ENSG00000181577 ENSG00000181577     C6orf223 protein_coding       chromosome
## ENSG00000172216 ENSG00000172216        CEBPB protein_coding       chromosome
## ENSG00000138621 ENSG00000138621        PPCDC protein_coding       chromosome
## ENSG00000273269 ENSG00000273269 RP11-761B3.1 protein_coding       chromosome
## ENSG00000186350 ENSG00000186350         RXRA protein_coding       chromosome
##                       symbol entrezid           closest_region
## ENSG00000125538         IL1B     3553 chr2:113587328-113594480
## ENSG00000181577     C6orf223   221416   chr6:43968317-43973695
## ENSG00000172216        CEBPB     1051  chr20:48807376-48809212
## ENSG00000138621        PPCDC    60490  chr15:75315896-75409803
## ENSG00000273269 RP11-761B3.1       NA   chr2:47293080-47403650
## ENSG00000186350         RXRA     6256 chr9:137208944-137332431
##                             query_region distance
## ENSG00000125538 chr2:113581628-113594911        0
## ENSG00000181577   chr6:44025105-44028184    51409
## ENSG00000172216  chr20:48889794-48893313    80581
## ENSG00000138621  chr15:75334903-75336779        0
## ENSG00000273269   chr2:47297968-47301173        0
## ENSG00000186350 chr9:137263243-137268534        0

We can also create coverage plots grouped by cluster around any genomic region using the CoveragePlot function. These represent ‘pseudo-bulk’ accessibility tracks, where all cells within a cluster have been averaged together, in order to visualize a more robust chromatin landscape (thanks to Andrew Hill for giving the inspiration for this function in his excellent blog post).

# set plotting order
levels(pbmc) <- c("CD4 Naive","CD4 Memory","CD8 Naive","CD8 Effector","DN T","NK CD56bright","NK CD56Dim","pre-B",'pro-B',"pDC","DC","CD14 Mono",'CD16 Mono')

  object = pbmc,
  region = rownames(da_peaks)[c(1,5)],
  sep = c(":", "-"),
  peaks = StringToGRanges(rownames(pbmc), sep = c(":", "-")),
  annotation = EnsDb.Hsapiens.v75,
  extend.upstream = 20000,
  extend.downstream = 20000,
  ncol = 1

Working with datasets that were not quantified using CellRanger

The CellRanger software from 10x Genomics generates several useful QC metrics per-cell, as well as a peak/cell matrix and an indexed fragments file. In the above vignette, we utilize the CellRanger outputs, but provide alternative functions in Signac for many of the same purposes here.

Generating a peak/cell or bin/cell matrix

The FeatureMatrix function can be used to generate a count matrix containing any set of genomic ranges in its rows. These regions could be a set of peaks, or bins that span the entire genome.

# not run
# peak_ranges should be a set of genomic ranges spanning the set of peaks to be quantified per cell
peak_matrix <- FeatureMatrix(
  fragments = fragment.path,
  features = peak_ranges

For convenience, we also include a GenomeBinMatrix function that will generate a set of genomic ranges spanning the entire genome for you, and run FeatureMatrix internally to produce a genome bin/cell matrix.

# not run
bin_matrix <- GenomeBinMatrix(
  fragments = fragment.path,
  genome = 'hg19',
  binsize = 5000

Counting fraction of reads in peaks

The function FRiP will count the fraction of reads in peaks for each cell, given a peak/cell assay and a bin/cell assay. Note that this can be run on a subset of the genome, so that a bin/cell assay does not need to be computed for the whole genome. This will return a Seurat object will metadata added corresponding to the fraction of reads in peaks for each cell.

# not run
pbmc <- FRiP(
  object = pbmc,
  peak.assay = 'peaks',
  bin.assay = 'bins'

Counting fragments in genome blacklist regions

The ratio of reads in genomic blacklist regions, that are known to artifactually accumulate reads in genome sequencing assays, can be diagnostic of low-quality cells. We provide blacklist region coordinates for several genomes (hg19, hg38, mm9, mm10, ce10, ce11, dm3, dm6) in the Signac package for convenience. These regions were provided by the ENCODE consortium, and we encourage users to cite their paper if you use the regions in your analysis. The FractionCountsInRegion function can be used to calculate the fraction of all counts within a given set of regions per cell. We can use this function and the blacklist regions to find the fraction of blacklist counts per cell.

# not run
pbmc <- FractionCountsInRegion(
  object = pbmc, 
  assay = 'peaks',
  regions = blacklist_hg19
## R version 3.6.1 (2019-07-05)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 18.04.3 LTS
## Matrix products: default
## BLAS:   /usr/lib/x86_64-linux-gnu/blas/
## LAPACK: /usr/lib/x86_64-linux-gnu/lapack/
## locale:
##  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
##  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
##  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
##  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
##  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
## attached base packages:
## [1] stats4    parallel  stats     graphics  grDevices utils     datasets 
## [8] methods   base     
## other attached packages:
##  [1] dplyr_0.8.3               ggplot2_3.2.1            
##  [3] EnsDb.Hsapiens.v75_2.99.0 ensembldb_2.8.1          
##  [5] AnnotationFilter_1.8.0    GenomicFeatures_1.36.4   
##  [7] AnnotationDbi_1.46.1      Biobase_2.44.0           
##  [9] GenomicRanges_1.36.1      GenomeInfoDb_1.20.0      
## [11] IRanges_2.18.3            S4Vectors_0.22.1         
## [13] BiocGenerics_0.30.0       Seurat_3.1.2             
## [15] Signac_0.2.0             
## loaded via a namespace (and not attached):
##   [1] backports_1.1.5             sn_1.5-4                   
##   [3] plyr_1.8.5                  igraph_1.2.4.2             
##   [5] lazyeval_0.2.2              splines_3.6.1              
##   [7] BiocParallel_1.18.1         listenv_0.8.0              
##   [9] TH.data_1.0-10              digest_0.6.23              
##  [11] htmltools_0.4.0             gdata_2.18.0               
##  [13] magrittr_1.5                memoise_1.1.0              
##  [15] BSgenome_1.52.0             cluster_2.1.0              
##  [17] ROCR_1.0-7                  ggfittext_0.8.1            
##  [19] globals_0.12.5              Biostrings_2.52.0          
##  [21] RcppParallel_4.4.4          matrixStats_0.55.0         
##  [23] R.utils_2.9.2               sandwich_2.5-1             
##  [25] pkgdown_1.4.1               prettyunits_1.1.0          
##  [27] colorspace_1.4-1            blob_1.2.0                 
##  [29] rappdirs_0.3.1              ggrepel_0.8.1              
##  [31] xfun_0.11                   crayon_1.3.4               
##  [33] RCurl_1.95-4.12             jsonlite_1.6               
##  [35] zeallot_0.1.0               survival_3.1-8             
##  [37] zoo_1.8-7                   ape_5.3                    
##  [39] glue_1.3.1                  gtable_0.3.0               
##  [41] zlibbioc_1.30.0             XVector_0.24.0             
##  [43] leiden_0.3.1                DelayedArray_0.10.0        
##  [45] future.apply_1.4.0          scales_1.1.0               
##  [47] mvtnorm_1.0-12              DBI_1.1.0                  
##  [49] bibtex_0.4.2.2              Rcpp_1.0.3                 
##  [51] metap_1.2                   plotrix_3.7-7              
##  [53] viridisLite_0.3.0           progress_1.2.2             
##  [55] reticulate_1.14             rsvd_1.0.2                 
##  [57] bit_1.1-15.1                SDMTools_1.1-221.2         
##  [59] tsne_0.1-3                  htmlwidgets_1.5.1          
##  [61] httr_1.4.1                  gplots_3.0.1.2             
##  [63] RColorBrewer_1.1-2          ellipsis_0.3.0             
##  [65] TFisher_0.2.0               ica_1.0-2                  
##  [67] farver_2.0.1                pkgconfig_2.0.3            
##  [69] XML_3.98-1.20               R.methodsS3_1.7.1          
##  [71] ggseqlogo_0.1               uwot_0.1.5                 
##  [73] labeling_0.3                reshape2_1.4.3             
##  [75] tidyselect_0.2.5            rlang_0.4.2                
##  [77] munsell_0.5.0               tools_3.6.1                
##  [79] RSQLite_2.2.0               ggridges_0.5.2             
##  [81] evaluate_0.14               stringr_1.4.0              
##  [83] yaml_2.2.0                  npsurv_0.4-0               
##  [85] knitr_1.26                  bit64_0.9-7                
##  [87] fs_1.3.1                    fitdistrplus_1.0-14        
##  [89] caTools_1.17.1.4            purrr_0.3.3                
##  [91] RANN_2.6.1                  pbapply_1.4-2              
##  [93] future_1.15.1               nlme_3.1-143               
##  [95] R.oo_1.23.0                 biomaRt_2.40.5             
##  [97] hdf5r_1.3.1                 compiler_3.6.1             
##  [99] curl_4.3                    png_0.1-7                  
## [101] plotly_4.9.1                lsei_1.2-0                 
## [103] tibble_2.1.3                stringi_1.4.5              
## [105] RSpectra_0.16-0             desc_1.2.0                 
## [107] lattice_0.20-38             ProtGenerics_1.16.0        
## [109] Matrix_1.2-18               multtest_2.40.0            
## [111] vctrs_0.2.1                 mutoss_0.1-12              
## [113] pillar_1.4.3                lifecycle_0.1.0            
## [115] Rdpack_0.11-1               lmtest_0.9-37              
## [117] RcppAnnoy_0.0.14            data.table_1.12.8          
## [119] cowplot_1.0.0               bitops_1.0-6               
## [121] irlba_2.3.3                 gbRd_0.4-11                
## [123] gggenes_0.4.0               patchwork_1.0.0            
## [125] rtracklayer_1.44.4          R6_2.4.1                   
## [127] gridExtra_2.3               KernSmooth_2.23-16         
## [129] codetools_0.2-16            MASS_7.3-51.5              
## [131] gtools_3.8.1                assertthat_0.2.1           
## [133] SummarizedExperiment_1.14.1 rprojroot_1.3-2            
## [135] withr_2.1.2                 sctransform_0.2.1          
## [137] GenomicAlignments_1.20.1    Rsamtools_2.0.3            
## [139] mnormt_1.5-5                multcomp_1.4-12            
## [141] GenomeInfoDbData_1.2.1      hms_0.5.3                  
## [143] grid_3.6.1                  tidyr_1.0.0                
## [145] rmarkdown_2.0               Rtsne_0.15                 
## [147] numDeriv_2016.8-1.1