1 Load libraries

library(MultiAssayExperiment)
library(SingleCellMultiModal)

2 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 .

2.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(): 2020-10-27
##    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:

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

mse
## 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 all data to files

Example with actual data:

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

2.2 Exploring the data structure

Check row annotations:

rownames(mse)
## 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(mse)
## 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

2.3 scRNA-seq data

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

head(experiments(mse)$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

2.4 scADT data

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

head(experiments(mse)$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

3 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")

4 Session Info

sessionInfo()
## R version 4.0.3 (2020-10-10)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 18.04.5 LTS
## 
## Matrix products: default
## BLAS:   /home/biocbuild/bbs-3.12-bioc/R/lib/libRblas.so
## LAPACK: /home/biocbuild/bbs-3.12-bioc/R/lib/libRlapack.so
## 
## locale:
##  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
##  [3] LC_TIME=en_US.UTF-8        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] parallel  stats4    stats     graphics  grDevices utils     datasets 
## [8] methods   base     
## 
## other attached packages:
##  [1] SingleCellMultiModal_1.2.4  MultiAssayExperiment_1.16.0
##  [3] SummarizedExperiment_1.20.0 Biobase_2.50.0             
##  [5] GenomicRanges_1.42.0        GenomeInfoDb_1.26.2        
##  [7] IRanges_2.24.1              S4Vectors_0.28.1           
##  [9] BiocGenerics_0.36.0         MatrixGenerics_1.2.0       
## [11] matrixStats_0.57.0          BiocStyle_2.18.1           
## 
## loaded via a namespace (and not attached):
##  [1] Rcpp_1.0.6                    lattice_0.20-41              
##  [3] SingleCellExperiment_1.12.0   assertthat_0.2.1             
##  [5] digest_0.6.27                 mime_0.9                     
##  [7] BiocFileCache_1.14.0          R6_2.5.0                     
##  [9] RSQLite_2.2.3                 evaluate_0.14                
## [11] httr_1.4.2                    pillar_1.4.7                 
## [13] zlibbioc_1.36.0               rlang_0.4.10                 
## [15] curl_4.3                      blob_1.2.1                   
## [17] Matrix_1.3-2                  rmarkdown_2.6                
## [19] AnnotationHub_2.22.0          stringr_1.4.0                
## [21] RCurl_1.98-1.2                bit_4.0.4                    
## [23] shiny_1.6.0                   DelayedArray_0.16.1          
## [25] compiler_4.0.3                httpuv_1.5.5                 
## [27] xfun_0.20                     pkgconfig_2.0.3              
## [29] htmltools_0.5.1.1             tidyselect_1.1.0             
## [31] tibble_3.0.5                  GenomeInfoDbData_1.2.4       
## [33] interactiveDisplayBase_1.28.0 bookdown_0.21                
## [35] withr_2.4.1                   crayon_1.3.4                 
## [37] dplyr_1.0.3                   dbplyr_2.0.0                 
## [39] later_1.1.0.1                 bitops_1.0-6                 
## [41] rappdirs_0.3.2                grid_4.0.3                   
## [43] xtable_1.8-4                  lifecycle_0.2.0              
## [45] DBI_1.1.1                     magrittr_2.0.1               
## [47] stringi_1.5.3                 cachem_1.0.1                 
## [49] XVector_0.30.0                promises_1.1.1               
## [51] SpatialExperiment_1.0.0       ellipsis_0.3.1               
## [53] generics_0.1.0                vctrs_0.3.6                  
## [55] tools_4.0.3                   bit64_4.0.5                  
## [57] glue_1.4.2                    BiocVersion_3.12.0           
## [59] purrr_0.3.4                   fastmap_1.1.0                
## [61] yaml_2.2.1                    AnnotationDbi_1.52.0         
## [63] ExperimentHub_1.16.0          BiocManager_1.30.10          
## [65] memoise_2.0.0                 knitr_1.31

5 References