In this vignette we will analyse a single-cell co-assay dataset measuring gene expression and DNA accessibility in the same cells. This vignette is similar to the PBMC multiomic vignette, but demonstrates a similar joint analysis in a different species and with data gathered using a different technology.

This dataset was published by Chen, Lake, and Zhang (2019) and uses a technology called SNARE-seq. We will look at a dataset from the adult mouse brain, and the raw data can be downloaded from NCBI GEO here: https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE126074

As the fragment files for this dataset are not publicly available we have re-mapped the raw data to the mm10 genome and created a fragment file using Sinto.

The fragment file can be downloaded here: https://signac-objects.s3.amazonaws.com/snareseq/fragments.sort.bed.gz

The fragment file index can be downloaded here: https://signac-objects.s3.amazonaws.com/snareseq/fragments.sort.bed.gz.tbi

Code used to create the fragment file from raw data is available here: https://github.com/timoast/SNARE-seq

Data loading

First we create a Seurat object containing two different assays, one containing the gene expression data and one containing the DNA accessibility data.

To load the count data, we can use the Read10X() function from Seurat by first placing the barcodes.tsv.gz, matrix.mtx.gz, and features.tsv.gz files into a separate folder.

library(Signac)
library(Seurat)
library(ggplot2)
library(EnsDb.Mmusculus.v79)

# load processed data matrices for each assay
rna <- Read10X("../vignette_data/snare-seq/GSE126074_AdBrainCortex_rna/", gene.column = 1)
atac <- Read10X("../vignette_data/snare-seq/GSE126074_AdBrainCortex_atac/", gene.column = 1)
fragments <- "../vignette_data/snare-seq/fragments.sort.bed.gz"

# create a Seurat object and add the assays
snare <- CreateSeuratObject(counts = rna)
snare[['ATAC']] <- CreateChromatinAssay(
  counts = atac,
  sep = c(":", "-"),
  genome = "mm10",
  fragments = fragments
)

# extract gene annotations from EnsDb
annotations <- GetGRangesFromEnsDb(ensdb = EnsDb.Mmusculus.v79)

# change to UCSC style since the data was mapped to mm10
seqlevels(annotations) <- paste0('chr', seqlevels(annotations))
genome(annotations) <- "mm10"

# add the gene information to the object
Annotation(snare[["ATAC"]]) <- annotations

Quality control

DefaultAssay(snare) <- "ATAC"
snare <- TSSEnrichment(snare)
snare <- NucleosomeSignal(snare)
snare$blacklist_fraction <- FractionCountsInRegion(
  object = snare,
  assay = 'ATAC',
  regions = blacklist_mm10
)
Idents(snare) <- "all"  # group all cells together, rather than by replicate
VlnPlot(
  snare,
  features = c("nCount_RNA", "nCount_ATAC", "TSS.enrichment",
               "nucleosome_signal", "blacklist_fraction"),
  pt.size = 0.1,
  ncol = 5
)

snare <- subset(
  x = snare,
  subset = blacklist_fraction < 0.03 &
    TSS.enrichment < 20 &
    nCount_RNA > 800 &
    nCount_ATAC > 500
)
snare
## An object of class Seurat 
## 277704 features across 8055 samples within 2 assays 
## Active assay: ATAC (244544 features, 0 variable features)
##  1 other assay present: RNA

Gene expression data processing

Process gene expression data using Seurat

DefaultAssay(snare) <- "RNA"

snare <- FindVariableFeatures(snare, nfeatures = 3000)
snare <- NormalizeData(snare)
snare <- ScaleData(snare)
snare <- RunPCA(snare, npcs = 30)
snare <- RunUMAP(snare, dims = 1:30, reduction.name = "umap.rna")
snare <- FindNeighbors(snare, dims = 1:30)
snare <- FindClusters(snare, resolution = 0.5, algorithm = 3)
## Modularity Optimizer version 1.3.0 by Ludo Waltman and Nees Jan van Eck
## 
## Number of nodes: 8055
## Number of edges: 324240
## 
## Running smart local moving algorithm...
## Maximum modularity in 10 random starts: 0.8900
## Number of communities: 14
## Elapsed time: 4 seconds
p1 <- DimPlot(snare, label = TRUE) + NoLegend() + ggtitle("RNA UMAP")

DNA accessibility data processing

Process the DNA accessibility data using Signac

DefaultAssay(snare) <- 'ATAC'

snare <- FindTopFeatures(snare, min.cutoff = 10)
snare <- RunTFIDF(snare)
snare <- RunSVD(snare)
snare <- RunUMAP(snare, reduction = 'lsi', dims = 2:30, reduction.name = 'umap.atac')
p2 <- DimPlot(snare, reduction = 'umap.atac', label = TRUE) + NoLegend() + ggtitle("ATAC UMAP")
p1 + p2

Integration with scRNA-seq data

Next we can annotate cell types in the dataset by transferring labels from an existing scRNA-seq dataset for the adult mouse brain, produced by the Allen Institute.

You can download the raw data for this experiment from the Allen Institute website, and view the code used to construct this object on GitHub. Alternatively, you can download the pre-processed Seurat object here.

# label transfer from Allen brain
allen <- readRDS("../vignette_data/allen_brain.rds")

# use the RNA assay in the SNARE-seq data for integration with scRNA-seq
DefaultAssay(snare) <- 'RNA'

transfer.anchors <- FindTransferAnchors(
  reference = allen,
  query = snare,
  dims = 1:30,
  reduction = 'cca'
)

predicted.labels <- TransferData(
  anchorset = transfer.anchors,
  refdata = allen$subclass,
  weight.reduction = snare[['pca']],
  dims = 1:30
)

snare <- AddMetaData(object = snare, metadata = predicted.labels)
# label clusters based on predicted ID
new.cluster.ids <- c(
  "L2/3 IT",
  "L4",
  "L6 IT",
  "L5 CT",
  "L4",
  "L5 PT",
  "Pvalb",
  "Sst",
  "Astro",
  "Oligo",
  "Vip/Lamp5",
  "L6 IT.2",
  "L6b",
  "NP"
)
names(x = new.cluster.ids) <- levels(x = snare)
snare <- RenameIdents(object = snare, new.cluster.ids)
snare$celltype <- Idents(snare)
DimPlot(snare, group.by = 'celltype', label = TRUE, reduction = 'umap.rna')

Jointly visualizing gene expression and DNA accessibility

We can visualize both the gene expression and DNA accessibility information at the same time using the CoveragePlot() function. This makes it easy to compare DNA accessibility in a given region for different cell types and overlay gene expression information for different genes.

DefaultAssay(snare) <- "ATAC"
CoveragePlot(snare, region = "chr2-22620000-22660000", features = "Gad2")

Session Info
## R version 4.3.1 (2023-06-16)
## Platform: aarch64-apple-darwin20 (64-bit)
## Running under: macOS Sonoma 14.0
## 
## Matrix products: default
## BLAS:   /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRblas.0.dylib 
## LAPACK: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.11.0
## 
## locale:
## [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
## 
## time zone: Asia/Singapore
## tzcode source: internal
## 
## attached base packages:
## [1] stats4    stats     graphics  grDevices utils     datasets  methods  
## [8] base     
## 
## other attached packages:
##  [1] EnsDb.Mmusculus.v79_2.99.0 ensembldb_2.24.1          
##  [3] AnnotationFilter_1.24.0    GenomicFeatures_1.52.2    
##  [5] AnnotationDbi_1.62.2       Biobase_2.60.0            
##  [7] GenomicRanges_1.52.0       GenomeInfoDb_1.36.3       
##  [9] IRanges_2.34.1             S4Vectors_0.38.2          
## [11] BiocGenerics_0.46.0        ggplot2_3.4.4             
## [13] SeuratObject_4.1.4         Seurat_4.4.0              
## [15] Signac_1.11.0             
## 
## loaded via a namespace (and not attached):
##   [1] fs_1.6.3                    ProtGenerics_1.32.0        
##   [3] matrixStats_1.0.0           spatstat.sparse_3.0-2      
##   [5] bitops_1.0-7                httr_1.4.7                 
##   [7] RColorBrewer_1.1-3          tools_4.3.1                
##   [9] sctransform_0.4.0           backports_1.4.1            
##  [11] utf8_1.2.3                  R6_2.5.1                   
##  [13] lazyeval_0.2.2              uwot_0.1.16                
##  [15] withr_2.5.1                 sp_2.1-0                   
##  [17] prettyunits_1.2.0           gridExtra_2.3              
##  [19] progressr_0.14.0            cli_3.6.1                  
##  [21] textshaping_0.3.7           spatstat.explore_3.2-3     
##  [23] labeling_0.4.3              sass_0.4.7                 
##  [25] spatstat.data_3.0-1         ggridges_0.5.4             
##  [27] pbapply_1.7-2               pkgdown_2.0.7              
##  [29] Rsamtools_2.16.0            systemfonts_1.0.5          
##  [31] foreign_0.8-84              R.utils_2.12.2             
##  [33] dichromat_2.0-0.1           parallelly_1.36.0          
##  [35] BSgenome_1.68.0             rstudioapi_0.15.0          
##  [37] RSQLite_2.3.1               generics_0.1.3             
##  [39] BiocIO_1.10.0               ica_1.0-3                  
##  [41] spatstat.random_3.1-6       dplyr_1.1.3                
##  [43] Matrix_1.6-1.1              ggbeeswarm_0.7.2           
##  [45] fansi_1.0.5                 abind_1.4-5                
##  [47] R.methodsS3_1.8.2           lifecycle_1.0.3            
##  [49] yaml_2.3.7                  SummarizedExperiment_1.30.2
##  [51] BiocFileCache_2.8.0         Rtsne_0.16                 
##  [53] grid_4.3.1                  blob_1.2.4                 
##  [55] promises_1.2.1              crayon_1.5.2               
##  [57] miniUI_0.1.1.1              lattice_0.21-8             
##  [59] cowplot_1.1.1               KEGGREST_1.40.1            
##  [61] pillar_1.9.0                knitr_1.44                 
##  [63] rjson_0.2.21                future.apply_1.11.0        
##  [65] codetools_0.2-19            fastmatch_1.1-4            
##  [67] leiden_0.4.3                glue_1.6.2                 
##  [69] data.table_1.14.8           vctrs_0.6.3                
##  [71] png_0.1-8                   gtable_0.3.4               
##  [73] cachem_1.0.8                xfun_0.40                  
##  [75] S4Arrays_1.0.6              mime_0.12                  
##  [77] survival_3.5-5              RcppRoll_0.3.0             
##  [79] ellipsis_0.3.2              fitdistrplus_1.1-11        
##  [81] ROCR_1.0-11                 nlme_3.1-162               
##  [83] bit64_4.0.5                 progress_1.2.2             
##  [85] filelock_1.0.2              RcppAnnoy_0.0.21           
##  [87] rprojroot_2.0.3             bslib_0.5.1                
##  [89] irlba_2.3.5.1               vipor_0.4.5                
##  [91] KernSmooth_2.23-21          rpart_4.1.19               
##  [93] colorspace_2.1-0            DBI_1.1.3                  
##  [95] Hmisc_5.1-1                 nnet_7.3-19                
##  [97] ggrastr_1.0.2               tidyselect_1.2.0           
##  [99] bit_4.0.5                   compiler_4.3.1             
## [101] curl_5.1.0                  htmlTable_2.4.1            
## [103] xml2_1.3.5                  desc_1.4.2                 
## [105] DelayedArray_0.26.7         plotly_4.10.2              
## [107] rtracklayer_1.60.1          checkmate_2.2.0            
## [109] scales_1.2.1                lmtest_0.9-40              
## [111] rappdirs_0.3.3              stringr_1.5.0              
## [113] digest_0.6.33               goftest_1.2-3              
## [115] spatstat.utils_3.0-3        rmarkdown_2.25             
## [117] XVector_0.40.0              htmltools_0.5.6.1          
## [119] pkgconfig_2.0.3             base64enc_0.1-3            
## [121] MatrixGenerics_1.12.3       dbplyr_2.3.4               
## [123] fastmap_1.1.1               rlang_1.1.1                
## [125] htmlwidgets_1.6.2           shiny_1.7.5                
## [127] farver_2.1.1                jquerylib_0.1.4            
## [129] zoo_1.8-12                  jsonlite_1.8.7             
## [131] BiocParallel_1.34.2         R.oo_1.25.0                
## [133] VariantAnnotation_1.46.0    RCurl_1.98-1.12            
## [135] magrittr_2.0.3              Formula_1.2-5              
## [137] GenomeInfoDbData_1.2.10     patchwork_1.1.3            
## [139] munsell_0.5.0               Rcpp_1.0.11                
## [141] reticulate_1.32.0           stringi_1.7.12             
## [143] zlibbioc_1.46.0             MASS_7.3-60                
## [145] plyr_1.8.9                  parallel_4.3.1             
## [147] listenv_0.9.0               ggrepel_0.9.3              
## [149] deldir_1.0-9                Biostrings_2.68.1          
## [151] splines_4.3.1               tensor_1.5                 
## [153] hms_1.1.3                   igraph_1.5.1               
## [155] spatstat.geom_3.2-5         reshape2_1.4.4             
## [157] biomaRt_2.56.1              XML_3.99-0.14              
## [159] evaluate_0.22               biovizBase_1.48.0          
## [161] httpuv_1.6.11               RANN_2.6.1                 
## [163] tidyr_1.3.0                 purrr_1.0.2                
## [165] polyclip_1.10-6             future_1.33.0              
## [167] scattermore_1.2             xtable_1.8-4               
## [169] restfulr_0.0.15             later_1.3.1                
## [171] viridisLite_0.4.2           ragg_1.2.6                 
## [173] tibble_3.2.1                memoise_2.0.1              
## [175] beeswarm_0.4.0              GenomicAlignments_1.36.0   
## [177] cluster_2.1.4               globals_0.16.2