Contents

1 Introduction

The scRNAseq package provides convenient access to several publicly available single-cell datasets in the form of SingleCellExperiment objects. We do all of the necessary data munging for each dataset beforehand, so that users can obtain a SingleCellExperiment for immediate use in further analyses. To enable discovery, each dataset is decorated with metadata such as the study title/abstract, the species involved, the number of cells, etc. Users can also contribute their own published datasets to enable re-use by the wider Bioconductor community.

2 Finding datasets

The surveyDatasets() function will show all available datasets along with their metadata. This can be used to discover interesting datasets for further analysis.

library(scRNAseq)
all.ds <- surveyDatasets()
all.ds
## DataFrame with 83 rows and 15 columns
##                       name     version        path                 object
##                <character> <character> <character>            <character>
## 1       romanov-brain-2017  2023-12-19          NA single_cell_experiment
## 2       nestorowa-hsc-2016  2023-12-19          NA single_cell_experiment
## 3      campbell-brain-2017  2023-12-14          NA single_cell_experiment
## 4    zhong-prefrontal-2018  2023-12-22          NA single_cell_experiment
## 5         tasic-brain-2016  2023-12-19          NA single_cell_experiment
## ...                    ...         ...         ...                    ...
## 79          he-organs-2020  2023-12-21      spleen single_cell_experiment
## 80          he-organs-2020  2023-12-21     stomach single_cell_experiment
## 81          he-organs-2020  2023-12-21     trachea single_cell_experiment
## 82  ernst-spermatogenesi..  2023-12-21  cellranger single_cell_experiment
## 83  ernst-spermatogenesi..  2023-12-21  emptydrops single_cell_experiment
##                      title            description taxonomy_id genome      rows
##                <character>            <character>      <List> <List> <integer>
## 1   Molecular interrogat.. Molecular interrogat..       10090 GRCm38     24341
## 2   A single-cell resolu.. A single-cell resolu..       10090 GRCm38     46078
## 3   A molecular census o.. A molecular census o..       10090 GRCm38     26774
## 4   A single-cell RNA-se.. A single-cell RNA-se..        9606 GRCh38     24153
## 5   Adult mouse cortical.. Adult mouse cortical..       10090 GRCm38     24058
## ...                    ...                    ...         ...    ...       ...
## 79  Single-cell transcri.. Single-cell transcri..        9606 GRCh38     15321
## 80  Single-cell transcri.. Single-cell transcri..        9606 GRCh38     16566
## 81  Single-cell transcri.. Single-cell transcri..        9606 GRCh38     18505
## 82  Staged developmental.. Staged developmental..       10090 GRCm38     33226
## 83  Staged developmental.. Staged developmental..       10090 GRCm38     32105
##       columns assays
##     <integer> <List>
## 1        2881 counts
## 2        1920 counts
## 3       21086 counts
## 4        2394 counts
## 5        1809 counts
## ...       ...    ...
## 79       4512 counts
## 80       5318 counts
## 81       7522 counts
## 82      53510 counts
## 83      68937 counts
##                                                 column_annotations
##                                                             <List>
## 1   level1 class,level2 class (neuron..,level2 cluster numbe..,...
## 2                                         gate,broad,broad.mpp,...
## 3                                            group,batches,sex,...
## 4                            developmental_stage,gender,sample,...
## 5                         mouse_line,cre_driver_1,cre_driver_2,...
## ...                                                            ...
## 79                              Tissue,nCount_RNA,nFeature_RNA,...
## 80                              Tissue,nCount_RNA,nFeature_RNA,...
## 81                              Tissue,nCount_RNA,nFeature_RNA,...
## 82                                      Sample,Barcode,Library,...
## 83                                      Sample,Barcode,Library,...
##     reduced_dimensions alternative_experiments
##                 <List>                  <List>
## 1                                             
## 2            diffusion               ERCC,FACS
## 3                                             
## 4                                             
## 5                                         ERCC
## ...                ...                     ...
## 79                TSNE                        
## 80                TSNE                        
## 81                TSNE                        
## 82                                            
## 83                                            
##                                                                                  sources
##                                                                     <SplitDataFrameList>
## 1                                                     GEO:GSE74672:NA,PubMed:27991900:NA
## 2               GEO:GSE81682:NA,PubMed:27365425:NA,URL:http://blood.stemcel..:2024-02-23
## 3                                                     GEO:GSE93374:NA,PubMed:28166221:NA
## 4                                                    GEO:GSE104276:NA,PubMed:29539641:NA
## 5                                                     PubMed:26727548:NA,GEO:GSE71585:NA
## ...                                                                                  ...
## 79  GEO:GSE159929:NA,PubMed:33287869:NA,GitHub:bei-lab/scRNA-AHCA:45c4b104e66f82729b00..
## 80  GEO:GSE159929:NA,PubMed:33287869:NA,GitHub:bei-lab/scRNA-AHCA:45c4b104e66f82729b00..
## 81  GEO:GSE159929:NA,PubMed:33287869:NA,GitHub:bei-lab/scRNA-AHCA:45c4b104e66f82729b00..
## 82                                        ArrayExpress:E-MTAB-6946:NA,PubMed:30890697:NA
## 83                                        ArrayExpress:E-MTAB-6946:NA,PubMed:30890697:NA

Users can also search on the metadata text using the searchDatasets() function. This accepts both simple text queries as well as more complicated expressions involving boolean operations.

# Find all datasets involving pancreas.
searchDatasets("pancreas")[,c("name", "title")]
## DataFrame with 5 rows and 2 columns
##                    name                  title
##             <character>            <character>
## 1 grun-bone_marrow-2016 De Novo Prediction o..
## 2  muraro-pancreas-2016 A Single-Cell Transc..
## 3    grun-pancreas-2016 De Novo Prediction o..
## 4   baron-pancreas-2016 A Single-Cell Transc..
## 5   baron-pancreas-2016 A Single-Cell Transc..
# Find all mm10 datasets involving pancreas or neurons.
searchDatasets(
   defineTextQuery("GRCm38", field="genome") &
   (defineTextQuery("neuro%", partial=TRUE) | 
    defineTextQuery("pancrea%", partial=TRUE))
)[,c("name", "title")]
## DataFrame with 13 rows and 2 columns
##                       name                  title
##                <character>            <character>
## 1       romanov-brain-2017 Molecular interrogat..
## 2      campbell-brain-2017 A molecular census o..
## 3   fletcher-olfactory-2.. Deconstructing Olfac..
## 4           hu-cortex-2017 Dissecting cell-type..
## 5           hu-cortex-2017 Dissecting cell-type..
## ...                    ...                    ...
## 9         jessa-brain-2019 Stalled developmenta..
## 10     zeisel-nervous-2018 Molecular Architectu..
## 11       zeisel-brain-2015 Brain structure. Cel..
## 12     shekhar-retina-2016 Comprehensive Classi..
## 13     baron-pancreas-2016 A Single-Cell Transc..

Keep in mind that the search results are not guaranteed to be reproducible - more datasets may be added over time, and existing datasets may be updated with new versions. Once a dataset of interest is identified, users should explicitly list the name and version of the dataset in their scripts to ensure reproducibility.

3 Loading a dataset

The fetchDataset() function will download a particular dataset, returning it as a SingleCellExperiment:

sce <- fetchDataset("zeisel-brain-2015", "2023-12-14")
sce
## class: SingleCellExperiment 
## dim: 20006 3005 
## metadata(0):
## assays(1): counts
## rownames(20006): Tspan12 Tshz1 ... mt-Rnr1 mt-Nd4l
## rowData names(1): featureType
## colnames(3005): 1772071015_C02 1772071017_G12 ... 1772066098_A12
##   1772058148_F03
## colData names(9): tissue group # ... level1class level2class
## reducedDimNames(0):
## mainExpName: gene
## altExpNames(2): repeat ERCC

For studies that generate multiple datasets, the dataset of interest must be explicitly requested via the path= argument:

sce <- fetchDataset("baron-pancreas-2016", "2023-12-14", path="human")
sce
## class: SingleCellExperiment 
## dim: 20125 8569 
## metadata(0):
## assays(1): counts
## rownames(20125): A1BG A1CF ... ZZZ3 pk
## rowData names(0):
## colnames(8569): human1_lib1.final_cell_0001 human1_lib1.final_cell_0002
##   ... human4_lib3.final_cell_0700 human4_lib3.final_cell_0701
## colData names(2): donor label
## reducedDimNames(0):
## mainExpName: NULL
## altExpNames(0):

By default, array data is loaded as a file-backed DelayedArray from the HDF5Array package. Setting realize.assays=TRUE and/or realize.reduced.dims=TRUE will coerce these to more conventional in-memory representations like ordinary arrays or dgCMatrix objects.

assay(sce)
## <20125 x 8569> sparse DelayedMatrix object of type "integer":
##        human1_lib1.final_cell_0001 ... human4_lib3.final_cell_0701
##   A1BG                           0   .                           0
##   A1CF                           4   .                           0
##    A2M                           0   .                           0
##  A2ML1                           0   .                           0
## A4GALT                           0   .                           0
##    ...                           .   .                           .
## ZYG11B                           0   .                           0
##    ZYX                           2   .                           0
##  ZZEF1                           0   .                           0
##   ZZZ3                           0   .                           0
##     pk                           1   .                           0
sce <- fetchDataset("baron-pancreas-2016", "2023-12-14", path="human", realize.assays=TRUE)
class(assay(sce))
## [1] "dgCMatrix"
## attr(,"package")
## [1] "Matrix"

Users can also fetch the metadata associated with each dataset:

str(fetchMetadata("zeisel-brain-2015", "2023-12-14"))
## List of 9
##  $ title               : chr "Brain structure. Cell types in the mouse cortex and hippocampus revealed by single-cell RNA-seq"
##  $ description         : chr "The mammalian cerebral cortex supports cognitive functions such as sensorimotor integration, memory, and social"| __truncated__
##  $ taxonomy_id         :List of 1
##   ..$ : chr "10090"
##  $ genome              :List of 1
##   ..$ : chr "GRCm38"
##  $ sources             :List of 5
##   ..$ :List of 3
##   .. ..$ provider: chr "URL"
##   .. ..$ id      : chr "https://storage.googleapis.com/linnarsson-lab-www-blobs/blobs/cortex/expression_mRNA_17-Aug-2014.txt"
##   .. ..$ version : chr "2024-02-23"
##   ..$ :List of 3
##   .. ..$ provider: chr "URL"
##   .. ..$ id      : chr "https://storage.googleapis.com/linnarsson-lab-www-blobs/blobs/cortex/expression_rep_17-Aug-2014.txt"
##   .. ..$ version : chr "2024-02-23"
##   ..$ :List of 3
##   .. ..$ provider: chr "URL"
##   .. ..$ id      : chr "https://storage.googleapis.com/linnarsson-lab-www-blobs/blobs/cortex/expression_spikes_17-Aug-2014.txt"
##   .. ..$ version : chr "2024-02-23"
##   ..$ :List of 3
##   .. ..$ provider: chr "URL"
##   .. ..$ id      : chr "https://storage.googleapis.com/linnarsson-lab-www-blobs/blobs/cortex/expression_mito_17-Aug-2014.txt"
##   .. ..$ version : chr "2024-02-23"
##   ..$ :List of 2
##   .. ..$ provider: chr "PubMed"
##   .. ..$ id      : chr "25700174"
##  $ maintainer_name     : chr "Aaron Lun"
##  $ maintainer_email    : chr "infinite.monkeys.with.keyboards@gmail.com"
##  $ bioconductor_version: chr "3.19"
##  $ applications        :List of 1
##   ..$ takane:List of 3
##   .. ..$ type                  : chr "single_cell_experiment"
##   .. ..$ summarized_experiment :List of 4
##   .. .. ..$ rows              : int 20006
##   .. .. ..$ columns           : int 3005
##   .. .. ..$ assays            :List of 1
##   .. .. .. ..$ : chr "counts"
##   .. .. ..$ column_annotations:List of 9
##   .. .. .. ..$ : chr "tissue"
##   .. .. .. ..$ : chr "group #"
##   .. .. .. ..$ : chr "total mRNA mol"
##   .. .. .. ..$ : chr "well"
##   .. .. .. ..$ : chr "sex"
##   .. .. .. ..$ : chr "age"
##   .. .. .. ..$ : chr "diameter"
##   .. .. .. ..$ : chr "level1class"
##   .. .. .. ..$ : chr "level2class"
##   .. ..$ single_cell_experiment:List of 2
##   .. .. ..$ reduced_dimensions     : list()
##   .. .. ..$ alternative_experiments:List of 2
##   .. .. .. ..$ : chr "repeat"
##   .. .. .. ..$ : chr "ERCC"

4 Adding new datasets

Want to contribute your own dataset to this package? It’s easy! Just follow these simple steps for instant fame and prestige.

  1. Format your dataset as a SummarizedExperiment or SingleCellExperiment. Let’s just make up something here.

    library(SingleCellExperiment)
    sce <- SingleCellExperiment(list(counts=matrix(rpois(1000, lambda=1), 100, 10)))
    rownames(sce) <- sprintf("GENE_%i", seq_len(nrow(sce)))
    colnames(sce) <- head(LETTERS, 10)
  2. Assemble the metadata for your dataset. This should be a list structured as specified in the Bioconductor metadata schema Check out some examples from fetchMetadata() - note that the application.takane property will be automatically added later, and so can be omitted from the list that you create.

    meta <- list(
        title="My dataset",
        description="This is my dataset",
        taxonomy_id="10090",
        genome="GRCh38",
        sources=list(
            list(provider="GEO", id="GSE12345"),
            list(provider="PubMed", id="1234567")
        ),
        maintainer_name="Chihaya Kisaragi",
        maintainer_email="kisaragi.chihaya@765pro.com"
    )
  3. Save your SummarizedExperiment (or whatever object contains your dataset) to disk with saveDataset(). This saves the dataset into a “staging directory” using language-agnostic file formats - check out the alabaster framework for more details. In more complex cases involving multiple datasets, users may save each dataset into a subdirectory of the staging directory.

    # Simple case: you only have one dataset to upload.
    staging <- tempfile()
    saveDataset(sce, staging, meta)
    list.files(staging, recursive=TRUE)
    ## [1] "OBJECT"                       "_bioconductor.json"          
    ## [3] "assays/0/OBJECT"              "assays/0/array.h5"           
    ## [5] "assays/names.json"            "column_data/OBJECT"          
    ## [7] "column_data/basic_columns.h5" "row_data/OBJECT"             
    ## [9] "row_data/basic_columns.h5"
    # Complex case: you have multiple datasets to upload.
    staging <- tempfile()
    dir.create(staging)
    saveDataset(sce, file.path(staging, "foo"), meta)
    saveDataset(sce, file.path(staging, "bar"), meta) # etc.

    You can check that everything was correctly saved by reloading the on-disk data into the R session for inspection:

    alabaster.base::readObject(file.path(staging, "foo"))
    ## class: SingleCellExperiment 
    ## dim: 100 10 
    ## metadata(0):
    ## assays(1): counts
    ## rownames(100): GENE_1 GENE_2 ... GENE_99 GENE_100
    ## rowData names(0):
    ## colnames(10): A B ... I J
    ## colData names(0):
    ## reducedDimNames(0):
    ## mainExpName: NULL
    ## altExpNames(0):
  4. Open a pull request (PR) for the addition of a new dataset. You will need to provide a few things here:

    • The name of your dataset. This typically follows the format of {NAME}-{SYSTEM}-{YEAR}, where NAME is the last name of the first author of the study, SYSTEM is the biological system (e.g., tissue, cell types) being studied, and YEAR is the year of publication for the dataset.
    • The version of your dataset. This is usually just the current date… or whenever you started putting together the dataset for upload. The exact date doesn’t really matter as long as we can establish a timeline for later versions.
    • An Rmarkdown file containing the code used to assemble the dataset. This should be added to the scripts/ directory of this package, in order to provide some record of how the dataset was created.
  5. Wait for us to grant temporary upload permissions to your GitHub account.

  6. Upload your staging directory to gypsum backend with gypsum::uploadDirectory(). On the first call to this function, it will automatically prompt you to log into GitHub so that the backend can authenticate you. If you are on a system without browser access (e.g., most computing clusters), a token can be manually supplied via gypsum::setAccessToken().

    gypsum::uploadDirectory(staging, "scRNAseq", "my_dataset_name", "my_version")

    You can check that everything was successfully uploaded by calling fetchDataset() with the same name and version:

    fetchDataset("my_dataset_name", "my_version")

    If you realized you made a mistake, no worries. Use the following call to clear the erroneous dataset, and try again:

    gypsum::rejectProbation("scRNAseq", "my_dataset_name", "my_version")
  7. Comment on the PR to notify us that the dataset has finished uploading and you’re happy with it. We’ll review it and make sure everything’s in order. If some fixes are required, we’ll just clear the dataset so that you can upload a new version with the necessary changes. Otherwise, we’ll approve the dataset. Note that once a version of a dataset is approved, no further changes can be made to that version; you’ll have to upload a new version if you want to modify something.

Session information

sessionInfo()
## R Under development (unstable) (2024-03-06 r86056)
## 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] scRNAseq_2.17.5             SingleCellExperiment_1.25.0
##  [3] SummarizedExperiment_1.33.3 Biobase_2.63.0             
##  [5] GenomicRanges_1.55.3        GenomeInfoDb_1.39.8        
##  [7] IRanges_2.37.1              S4Vectors_0.41.4           
##  [9] BiocGenerics_0.49.1         MatrixGenerics_1.15.0      
## [11] matrixStats_1.2.0           BiocStyle_2.31.0           
## 
## loaded via a namespace (and not attached):
##   [1] DBI_1.2.2                bitops_1.0-7             httr2_1.0.0             
##   [4] biomaRt_2.59.1           rlang_1.1.3              magrittr_2.0.3          
##   [7] gypsum_0.99.14           compiler_4.4.0           RSQLite_2.3.5           
##  [10] GenomicFeatures_1.55.3   png_0.1-8                vctrs_0.6.5             
##  [13] ProtGenerics_1.35.3      stringr_1.5.1            pkgconfig_2.0.3         
##  [16] crayon_1.5.2             fastmap_1.1.1            dbplyr_2.4.0            
##  [19] XVector_0.43.1           utf8_1.2.4               Rsamtools_2.19.3        
##  [22] rmarkdown_2.26           bit_4.0.5                xfun_0.42               
##  [25] aws.s3_0.3.21            zlibbioc_1.49.0          cachem_1.0.8            
##  [28] jsonlite_1.8.8           progress_1.2.3           blob_1.2.4              
##  [31] rhdf5filters_1.15.2      DelayedArray_0.29.9      Rhdf5lib_1.25.1         
##  [34] BiocParallel_1.37.1      parallel_4.4.0           prettyunits_1.2.0       
##  [37] R6_2.5.1                 bslib_0.6.1              stringi_1.8.3           
##  [40] rtracklayer_1.63.0       jquerylib_0.1.4          Rcpp_1.0.12             
##  [43] bookdown_0.38            knitr_1.45               base64enc_0.1-3         
##  [46] Matrix_1.6-5             tidyselect_1.2.1         abind_1.4-5             
##  [49] yaml_2.3.8               codetools_0.2-19         curl_5.2.1              
##  [52] alabaster.sce_1.3.3      lattice_0.22-5           tibble_3.2.1            
##  [55] KEGGREST_1.43.0          evaluate_0.23            BiocFileCache_2.11.1    
##  [58] alabaster.schemas_1.3.1  xml2_1.3.6               ExperimentHub_2.11.1    
##  [61] Biostrings_2.71.3        pillar_1.9.0             BiocManager_1.30.22     
##  [64] filelock_1.0.3           generics_0.1.3           RCurl_1.98-1.14         
##  [67] ensembldb_2.27.1         BiocVersion_3.19.1       hms_1.1.3               
##  [70] alabaster.base_1.3.22    alabaster.ranges_1.3.3   glue_1.7.0              
##  [73] lazyeval_0.2.2           alabaster.matrix_1.3.13  tools_4.4.0             
##  [76] AnnotationHub_3.11.1     BiocIO_1.13.0            GenomicAlignments_1.39.4
##  [79] XML_3.99-0.16.1          rhdf5_2.47.6             grid_4.4.0              
##  [82] jsonvalidate_1.3.2       AnnotationDbi_1.65.2     GenomeInfoDbData_1.2.11 
##  [85] HDF5Array_1.31.6         restfulr_0.0.15          cli_3.6.2               
##  [88] rappdirs_0.3.3           fansi_1.0.6              S4Arrays_1.3.6          
##  [91] dplyr_1.1.4              V8_4.4.2                 AnnotationFilter_1.27.0 
##  [94] alabaster.se_1.3.4       sass_0.4.8               digest_0.6.35           
##  [97] SparseArray_1.3.4        rjson_0.2.21             memoise_2.0.1           
## [100] htmltools_0.5.7          lifecycle_1.0.4          httr_1.4.7              
## [103] aws.signature_0.6.0      bit64_4.0.5