Contents

library(scATAC.Explorer)
#> Loading required package: SingleCellExperiment
#> Loading required package: SummarizedExperiment
#> Loading required package: MatrixGenerics
#> Loading required package: matrixStats
#> 
#> Attaching package: 'MatrixGenerics'
#> The following objects are masked from 'package:matrixStats':
#> 
#>     colAlls, colAnyNAs, colAnys, colAvgsPerRowSet, colCollapse,
#>     colCounts, colCummaxs, colCummins, colCumprods, colCumsums,
#>     colDiffs, colIQRDiffs, colIQRs, colLogSumExps, colMadDiffs,
#>     colMads, colMaxs, colMeans2, colMedians, colMins, colOrderStats,
#>     colProds, colQuantiles, colRanges, colRanks, colSdDiffs, colSds,
#>     colSums2, colTabulates, colVarDiffs, colVars, colWeightedMads,
#>     colWeightedMeans, colWeightedMedians, colWeightedSds,
#>     colWeightedVars, rowAlls, rowAnyNAs, rowAnys, rowAvgsPerColSet,
#>     rowCollapse, rowCounts, rowCummaxs, rowCummins, rowCumprods,
#>     rowCumsums, rowDiffs, rowIQRDiffs, rowIQRs, rowLogSumExps,
#>     rowMadDiffs, rowMads, rowMaxs, rowMeans2, rowMedians, rowMins,
#>     rowOrderStats, rowProds, rowQuantiles, rowRanges, rowRanks,
#>     rowSdDiffs, rowSds, rowSums2, rowTabulates, rowVarDiffs, rowVars,
#>     rowWeightedMads, rowWeightedMeans, rowWeightedMedians,
#>     rowWeightedSds, rowWeightedVars
#> Loading required package: GenomicRanges
#> Loading required package: stats4
#> Loading required package: BiocGenerics
#> 
#> Attaching package: 'BiocGenerics'
#> The following objects are masked from 'package:stats':
#> 
#>     IQR, mad, sd, var, xtabs
#> The following objects are masked from 'package:base':
#> 
#>     Filter, Find, Map, Position, Reduce, anyDuplicated, aperm, append,
#>     as.data.frame, basename, cbind, colnames, dirname, do.call,
#>     duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted,
#>     lapply, mapply, match, mget, order, paste, pmax, pmax.int, pmin,
#>     pmin.int, rank, rbind, rownames, sapply, setdiff, table, tapply,
#>     union, unique, unsplit, which.max, which.min
#> Loading required package: S4Vectors
#> 
#> Attaching package: 'S4Vectors'
#> The following object is masked from 'package:utils':
#> 
#>     findMatches
#> The following objects are masked from 'package:base':
#> 
#>     I, expand.grid, unname
#> Loading required package: IRanges
#> Loading required package: GenomeInfoDb
#> Loading required package: Biobase
#> Welcome to Bioconductor
#> 
#>     Vignettes contain introductory material; view with
#>     'browseVignettes()'. To cite Bioconductor, see
#>     'citation("Biobase")', and for packages 'citation("pkgname")'.
#> 
#> Attaching package: 'Biobase'
#> The following object is masked from 'package:MatrixGenerics':
#> 
#>     rowMedians
#> The following objects are masked from 'package:matrixStats':
#> 
#>     anyMissing, rowMedians
#> Loading required package: BiocFileCache
#> Loading required package: dbplyr
#> Loading required package: data.table
#> 
#> Attaching package: 'data.table'
#> The following object is masked from 'package:SummarizedExperiment':
#> 
#>     shift
#> The following object is masked from 'package:GenomicRanges':
#> 
#>     shift
#> The following object is masked from 'package:IRanges':
#> 
#>     shift
#> The following objects are masked from 'package:S4Vectors':
#> 
#>     first, second

1 Introduction

scATAC.Explorer (Single Cell ATAC-seq Explorer) is a curated collection of publicly available scATAC-seq datasets. It aims to provide a single point of entry for users looking to investigate epigenetics and chromatin accessibilty at a single cell resolution across many available datasets.

Users can quickly search available datasets using the metadata table, and then download any datasets they have discovered relevant to their research in a standard and easily accessible format. Optionally, users can save the datasets for use in applications other than R.

This package will improve the ease of studying the epigenome across a variety of organisims, cell types, and diseases. Developers may use this package to obtain data for validation of new algorithms, or to study differences between scATAC-seq datasets.

2 Exploring available datasets

Start by exploring the available datasets through metadata.

res = queryATAC(metadata_only = TRUE)
Reference Accession Author Journal Year
Satpathy_NatureBiotech_2019 GSE129785 Satpathy Nature Biotech 2019
Satpathy_NatureBiotech_2019 GSE129785 Satpathy Nature Biotech 2019
Satpathy_NatureBiotech_2019 GSE129785 Satpathy Nature Biotech 2019
Satpathy_NatureBiotech_2019 GSE129785 Satpathy Nature Biotech 2019
Buenrostro_Cell_2018 GSE96769 Buenrostro Cell 2018
Corces_NatureGenetics_2016 GSE74310 Corces Nature Genetics 2016

This will return a list containing a single dataframe of metadata for all available datasets. View the metadata with View(res[[1]]) and then check ?queryATAC for a description of searchable fields.

Note: in order to keep the function’s interface consistent, queryATAC always returns a list of objects, even if there is only one object. You may prefer running res = queryATAC(metadata_only = TRUE)[[1]] in order to save the dataframe directly.

The metatadata_only argument can be applied alongside any other argument in order to examine only datasets that have certain qualities. You can, for instance, view only breast cancer datasets by using

res = queryATAC(disease = 'leukemia', metadata_only = TRUE)[[1]]
Reference Accession Author Journal Year
6 Corces_NatureGenetics_2016 GSE74310 Corces Nature Genetics 2016
45 Satpathy_NatureMedicine_2018 GSE107817 Satpathy Nature Medicine 2018

Table 1: Search parameters for queryATAC alongside example values.
Search Parameter Description Examples
accession Search by unique accession number or ID GSE129785, GSE89362
has_cell_types Filter by presence of cell-type annotations TRUE, FALSE
has_clusters Filter by presence of cluster results TRUE, FALSE
disease Search by disease Carcinoma, Leukemia
broad_cell_category Search by broad cell cateogries present in datasets Neuronal, Immune
tissue_cell_type Search by tissue or cell type when available PBMC, glia, cerebral cortex
author Search by first author Satpathy, Cusanovich
journal Search by publication journal Science, Nature, Cell
year Search by year of publication <2015, >2015, 2013-2015
pmid Search by PubMed ID 27526324, 32494068
sequence_tech Search by sequencing technology 10x Genomics Chromium
organism Search by source organism Mus musculus
genome_build Search by genome build hg19, hg38, mm10
sparse Return expression in sparse matrices TRUE, FALSE

2.1 Searching by year

In order to search by single years and a range of years, the package looks for specific patterns. ‘2013-2015’ will search for datasets published between 2013 and 2015, inclusive. ‘<2015’ or ‘2015>’ will search for datasets published before or in 2015. ‘>2015’ or ‘2015<’ will search for datasets published in or after 2015.

3 Getting datasets

Once you’ve found a field to search on, you can get your data. For this example, we’re pulling a specific dataset by its GEO accession ID.

res = queryATAC(accession = "GSE89362")

This will return a list containing dataset GSE89362. The dataset is stored as a SingleCellExperiment object, which has the following metadata attached to the object:


Table 2: Metadata attributes in the SingleCellExperiment object.
Attribute Description
cells A list of cells included in the study
regions A list of genomic regions (peaks) included in the study
pmid The PubMed ID of the study
technology The sequencing technology used
genome_build The genome build used for data generation
score_type The type of scoring or normalization used on the counts data
organism The type of organism from which cells were sequenced
author The first author of the paper presenting the data
disease The diseases sampled cells were sampled from
summary A broad summary of the study conditions the sample was assayed from
accession The GEO accession ID for the dataset

To access the chromatin accessibility counts data for a result, use

View(counts(res[[1]]))
Ik0h.r1.A1 Ik0h.r1.A2 Ik0h.r1.A3 Ik0h.r1.A4 Ik0h.r1.A5 Ik0h.r1.A6 Ik0h.r1.B10 Ik0h.r1.B12
chr1-63176687-63176922 0 0 0 0 0 0 0 0
chr1-125435762-125435907 1 1 1 0 0 0 1 0
chr1-139067353-139067473 0 2 0 0 0 0 0 0
chr1-152305577-152305725 0 0 0 0 0 0 0 0
chr1-9748401-9748588 1 2 0 0 0 0 1 2
chr1-51478424-51478572 0 1 0 0 1 0 1 0
chr1-53296958-53297153 0 0 0 0 0 0 0 0
chr1-53313523-53313648 0 0 0 0 0 0 2 0
chr1-75251656-75251790 0 0 0 0 0 0 0 0
chr1-105971701-105971845 1 0 0 0 0 0 2 1

Cell type labels and/or cluster assignments are stored under colData(res[[1]]) for datasets for which cell type labels and cluster assignments are available.

Metadata is stored in a named list accessible by metadata(res[[1]]). Specific entries can be accessed by attribute name.

metadata(res[[1]])$pmid
#> [1] "31682608"

3.1 Example: Returning all datasets with cell-type labels

Say you want to compare chromatin accessibility between known cell types. To do this, you need datasets that have cell-type annotations available. Be aware that returning a large amount of datasets like this will require a large amount of memory (greater than 16GB, if not more).

res = queryATAC(has_cell_type = TRUE)

This will return a list of all datasets that have cell-types annotations available. You can see the cell types for the first dataset using the following command:

View(colData(res[[1]]))
Ik0h.r1.A1
Ik0h.r1.A2
Ik0h.r1.A3
Ik0h.r1.A4
Ik0h.r1.A5
Ik0h.r1.A6

The first column of this dataframe contains the cell cluster assignment (if available), and the second contains the cell type assignment (if available). The row names of the dataframe specify the cell ID/barcode the annotation belongs to.

4 Saving Data

To facilitate the use of any or all datasets outside of R, you can use saveATAC(). saveATAC takes two parameters. The first parameter is the data object to be saved (ie. a SingleCellExperiment object from queryATAC()). The second paramter is a string specifying the directory you would like data to be saved in. Note that the output directory should not already exist.

To save the data from the earlier example to disk, use the following commands.

res = queryATAC(accession = "GSE89362")[[1]]
saveATAC(res, '~/Downloads/GSE89362')

The result is three files saving the scATAC-seq dataset in the Matrix Market format that can be used in other programs. A fourth csv file will be saved if cell type annotations or cluster assignments are available in the dataset.

5 Session Information

sessionInfo()
#> R version 4.4.0 beta (2024-04-15 r86425)
#> Platform: x86_64-pc-linux-gnu
#> Running under: Ubuntu 22.04.4 LTS
#> 
#> Matrix products: default
#> BLAS:   /home/biocbuild/bbs-3.19-bioc/R/lib/libRblas.so 
#> LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0
#> 
#> locale:
#>  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
#>  [3] LC_TIME=en_GB              LC_COLLATE=C              
#>  [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            
#> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
#> 
#> time zone: America/New_York
#> tzcode source: system (glibc)
#> 
#> attached base packages:
#> [1] stats4    stats     graphics  grDevices utils     datasets  methods  
#> [8] base     
#> 
#> other attached packages:
#>  [1] scATAC.Explorer_1.10.0      data.table_1.15.4          
#>  [3] BiocFileCache_2.12.0        dbplyr_2.5.0               
#>  [5] SingleCellExperiment_1.26.0 SummarizedExperiment_1.34.0
#>  [7] Biobase_2.64.0              GenomicRanges_1.56.0       
#>  [9] GenomeInfoDb_1.40.0         IRanges_2.38.0             
#> [11] S4Vectors_0.42.0            BiocGenerics_0.50.0        
#> [13] MatrixGenerics_1.16.0       matrixStats_1.3.0          
#> [15] BiocStyle_2.32.0           
#> 
#> loaded via a namespace (and not attached):
#>  [1] xfun_0.43               bslib_0.7.0             lattice_0.22-6         
#>  [4] vctrs_0.6.5             tools_4.4.0             generics_0.1.3         
#>  [7] curl_5.2.1              tibble_3.2.1            fansi_1.0.6            
#> [10] RSQLite_2.3.6           blob_1.2.4              pkgconfig_2.0.3        
#> [13] Matrix_1.7-0            lifecycle_1.0.4         GenomeInfoDbData_1.2.12
#> [16] compiler_4.4.0          htmltools_0.5.8.1       sass_0.4.9             
#> [19] yaml_2.3.8              pillar_1.9.0            crayon_1.5.2           
#> [22] jquerylib_0.1.4         DelayedArray_0.30.0     cachem_1.0.8           
#> [25] abind_1.4-5             tidyselect_1.2.1        digest_0.6.35          
#> [28] dplyr_1.1.4             purrr_1.0.2             bookdown_0.39          
#> [31] fastmap_1.1.1           grid_4.4.0              cli_3.6.2              
#> [34] SparseArray_1.4.0       magrittr_2.0.3          S4Arrays_1.4.0         
#> [37] utf8_1.2.4              filelock_1.0.3          UCSC.utils_1.0.0       
#> [40] bit64_4.0.5             rmarkdown_2.26          XVector_0.44.0         
#> [43] httr_1.4.7              bit_4.0.5               memoise_2.0.1          
#> [46] evaluate_0.23           knitr_1.46              rlang_1.1.3            
#> [49] glue_1.7.0              DBI_1.2.2               BiocManager_1.30.22    
#> [52] jsonlite_1.8.8          R6_2.5.1                zlibbioc_1.50.0