1 Installation

if (!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")

BiocManager::install("SingleCellMultiModal")

2 Load libraries

library(MultiAssayExperiment)
library(SingleCellMultiModal)

3 CITE-seq dataset

CITE-seq data are a combination of two data types extracted at the same time from the same cell. First data type is scRNA-seq data, while the second one consists of about a hundread of antibody-derived tags (ADT). In particular this dataset is provided by Stoeckius et al. (2017).

3.1 Downloading datasets

The user can see the available dataset by using the default options

CITEseq(DataType="cord_blood", modes="*", dry.run=TRUE, version="1.0.0")
## Dataset: cord_blood
## snapshotDate(): 2022-10-24
##    ah_id            mode file_size rdataclass rdatadateadded rdatadateremoved
## 1 EH3795    scADT_Counts    0.2 Mb     matrix     2020-09-23             <NA>
## 2 EH3796 scRNAseq_Counts   22.2 Mb     matrix     2020-09-23             <NA>

Or simply by setting dry.run = FALSE it downloads the data and creates the MultiAssayExperiment object.

In this example, we will use one of the two available datasets scADT_Counts:

mae <- CITEseq(
    DataType="cord_blood", modes="*", dry.run=FALSE, version="1.0.0"
)

mae
## A MultiAssayExperiment object of 2 listed
##  experiments with user-defined names and respective classes.
##  Containing an ExperimentList class object of length 2:
##  [1] scADT: matrix with 13 rows and 8617 columns
##  [2] scRNAseq: matrix with 36280 rows and 8617 columns
## Functionality:
##  experiments() - obtain the ExperimentList instance
##  colData() - the primary/phenotype DataFrame
##  sampleMap() - the sample coordination DataFrame
##  `$`, `[`, `[[` - extract colData columns, subset, or experiment
##  *Format() - convert into a long or wide DataFrame
##  assays() - convert ExperimentList to a SimpleList of matrices
##  exportClass() - save data to flat files

Example with actual data:

experiments(mae)
## ExperimentList class object of length 2:
##  [1] scADT: matrix with 13 rows and 8617 columns
##  [2] scRNAseq: matrix with 36280 rows and 8617 columns

3.2 Exploring the data structure

Check row annotations:

rownames(mae)
## CharacterList of length 2
## [["scADT"]] CD3 CD4 CD8 CD45RA CD56 CD16 CD10 CD11c CD14 CD19 CD34 CCR5 CCR7
## [["scRNAseq"]] ERCC_ERCC-00104 HUMAN_A1BG ... MOUSE_n-R5s25 MOUSE_n-R5s31

Take a peek at the sampleMap:

sampleMap(mae)
## DataFrame with 17234 rows and 3 columns
##          assay          primary          colname
##       <factor>      <character>      <character>
## 1        scADT CTGTTTACACCGCTAG CTGTTTACACCGCTAG
## 2        scADT CTCTACGGTGTGGCTC CTCTACGGTGTGGCTC
## 3        scADT AGCAGCCAGGCTCATT AGCAGCCAGGCTCATT
## 4        scADT GAATAAGAGATCCCAT GAATAAGAGATCCCAT
## 5        scADT GTGCATAGTCATGCAT GTGCATAGTCATGCAT
## ...        ...              ...              ...
## 17230 scRNAseq TTGCCGTGTAGATTAG TTGCCGTGTAGATTAG
## 17231 scRNAseq GGCGTGTAGTGTACTC GGCGTGTAGTGTACTC
## 17232 scRNAseq CGTATGCCGTCTTCTG CGTATGCCGTCTTCTG
## 17233 scRNAseq TACACGACGCTCTTCC TACACGACGCTCTTCC
## 17234 scRNAseq ACACGACGCTCTTCCG ACACGACGCTCTTCCG

3.3 scRNA-seq data

The scRNA-seq data are accessible with the name scRNAseq, which returns a matrix object.

head(experiments(mae)$scRNAseq)[, 1:4]
##                 CTGTTTACACCGCTAG CTCTACGGTGTGGCTC AGCAGCCAGGCTCATT
## ERCC_ERCC-00104                0                0                0
## HUMAN_A1BG                     0                0                0
## HUMAN_A1BG-AS1                 0                0                0
## HUMAN_A1CF                     0                0                0
## HUMAN_A2M                      0                0                0
## HUMAN_A2M-AS1                  0                0                0
##                 GAATAAGAGATCCCAT
## ERCC_ERCC-00104                0
## HUMAN_A1BG                     0
## HUMAN_A1BG-AS1                 0
## HUMAN_A1CF                     0
## HUMAN_A2M                      0
## HUMAN_A2M-AS1                  0

3.4 scADT data

The scADT data are accessible with the name scADT, which returns a matrix object.

head(experiments(mae)$scADT)[, 1:4]
##        CTGTTTACACCGCTAG CTCTACGGTGTGGCTC AGCAGCCAGGCTCATT GAATAAGAGATCCCAT
## CD3                  60               52               89               55
## CD4                  72               49              112               66
## CD8                  76               59               61               56
## CD45RA              575             3943              682              378
## CD56                 64               68               87               58
## CD16                161              107              117               82

4 SingleCellExperiment object conversion

Because of already large use of some methodologies (such as in the SingleCellExperiment vignette or CiteFuse Vignette where the SingleCellExperiment object is used for CITE-seq data, we provide a function for the conversion of our CITE-seq MultiAssayExperiment object into a SingleCellExperiment object with scRNA-seq data as counts and scADT data as altExps.

sce <- CITEseq(DataType="cord_blood", modes="*", dry.run=FALSE, version="1.0.0",
              DataClass="SingleCellExperiment")
sce
## class: SingleCellExperiment 
## dim: 36280 8617 
## metadata(0):
## assays(1): counts
## rownames(36280): ERCC_ERCC-00104 HUMAN_A1BG ... MOUSE_n-R5s25
##   MOUSE_n-R5s31
## rowData names(0):
## colnames(8617): CTGTTTACACCGCTAG CTCTACGGTGTGGCTC ... TACACGACGCTCTTCC
##   ACACGACGCTCTTCCG
## colData names(0):
## reducedDimNames(0):
## mainExpName: NULL
## altExpNames(1): scADT

5 Session Info

sessionInfo()
## R Under development (unstable) (2022-10-25 r83175)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 22.04.1 LTS
## 
## Matrix products: default
## BLAS:   /home/biocbuild/bbs-3.17-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       
## 
## attached base packages:
## [1] stats4    stats     graphics  grDevices utils     datasets  methods  
## [8] base     
## 
## other attached packages:
##  [1] SingleCellMultiModal_1.11.0 MultiAssayExperiment_1.25.1
##  [3] SummarizedExperiment_1.29.0 Biobase_2.59.0             
##  [5] GenomicRanges_1.51.0        GenomeInfoDb_1.35.0        
##  [7] IRanges_2.33.0              S4Vectors_0.37.0           
##  [9] BiocGenerics_0.45.0         MatrixGenerics_1.11.0      
## [11] matrixStats_0.62.0          BiocStyle_2.27.0           
## 
## loaded via a namespace (and not attached):
##  [1] DBI_1.1.3                     bitops_1.0-7                 
##  [3] formatR_1.12                  rlang_1.0.6                  
##  [5] magrittr_2.0.3                compiler_4.3.0               
##  [7] RSQLite_2.2.18                DelayedMatrixStats_1.21.0    
##  [9] png_0.1-7                     vctrs_0.5.0                  
## [11] stringr_1.4.1                 pkgconfig_2.0.3              
## [13] SpatialExperiment_1.9.0       crayon_1.5.2                 
## [15] fastmap_1.1.0                 magick_2.7.3                 
## [17] dbplyr_2.2.1                  XVector_0.39.0               
## [19] ellipsis_0.3.2                scuttle_1.9.0                
## [21] utf8_1.2.2                    promises_1.2.0.1             
## [23] rmarkdown_2.17                purrr_0.3.5                  
## [25] bit_4.0.4                     xfun_0.34                    
## [27] zlibbioc_1.45.0               cachem_1.0.6                 
## [29] beachmat_2.15.0               jsonlite_1.8.3               
## [31] blob_1.2.3                    later_1.3.0                  
## [33] rhdf5filters_1.11.0           DelayedArray_0.25.0          
## [35] Rhdf5lib_1.21.0               BiocParallel_1.33.0          
## [37] interactiveDisplayBase_1.37.0 parallel_4.3.0               
## [39] R6_2.5.1                      bslib_0.4.0                  
## [41] stringi_1.7.8                 limma_3.55.0                 
## [43] jquerylib_0.1.4               Rcpp_1.0.9                   
## [45] bookdown_0.29                 assertthat_0.2.1             
## [47] knitr_1.40                    R.utils_2.12.1               
## [49] httpuv_1.6.6                  Matrix_1.5-1                 
## [51] tidyselect_1.2.0              yaml_2.3.6                   
## [53] codetools_0.2-18              curl_4.3.3                   
## [55] lattice_0.20-45               tibble_3.1.8                 
## [57] withr_2.5.0                   shiny_1.7.3                  
## [59] KEGGREST_1.39.0               evaluate_0.17                
## [61] BiocFileCache_2.7.0           ExperimentHub_2.7.0          
## [63] Biostrings_2.67.0             pillar_1.8.1                 
## [65] BiocManager_1.30.19           filelock_1.0.2               
## [67] generics_0.1.3                RCurl_1.98-1.9               
## [69] BiocVersion_3.17.0            sparseMatrixStats_1.11.0     
## [71] xtable_1.8-4                  glue_1.6.2                   
## [73] tools_4.3.0                   AnnotationHub_3.7.0          
## [75] locfit_1.5-9.6                rhdf5_2.43.0                 
## [77] grid_4.3.0                    DropletUtils_1.19.0          
## [79] AnnotationDbi_1.61.0          edgeR_3.41.0                 
## [81] SingleCellExperiment_1.21.0   GenomeInfoDbData_1.2.9       
## [83] HDF5Array_1.27.0              cli_3.4.1                    
## [85] rappdirs_0.3.3                fansi_1.0.3                  
## [87] dplyr_1.0.10                  R.methodsS3_1.8.2            
## [89] sass_0.4.2                    digest_0.6.30                
## [91] dqrng_0.3.0                   rjson_0.2.21                 
## [93] memoise_2.0.1                 htmltools_0.5.3              
## [95] R.oo_1.25.0                   lifecycle_1.0.3              
## [97] httr_1.4.4                    mime_0.12                    
## [99] bit64_4.0.5

References

Stoeckius, Marlon, Christoph Hafemeister, William Stephenson, Brian Houck-Loomis, Pratip K Chattopadhyay, Harold Swerdlow, Rahul Satija, and Peter Smibert. 2017. “Simultaneous Epitope and Transcriptome Measurement in Single Cells.” Nature Methods 14 (9): 865.