Chapter 7 Human PBMCs (10X Genomics)

7.1 Introduction

This performs an analysis of the public PBMC ID dataset generated by 10X Genomics (Zheng et al. 2017), starting from the filtered count matrix.

7.3 Quality control

Cell calling implicitly serves as a QC step to remove libraries with low total counts and number of detected genes. Thus, we will only filter on the mitochondrial proportion.

Percentage of mitochondrial reads in each cell in each of the 10X PBMC datasets, compared to the total count. Each point represents a cell and is colored according to whether that cell was discarded.

Figure 7.1: Percentage of mitochondrial reads in each cell in each of the 10X PBMC datasets, compared to the total count. Each point represents a cell and is colored according to whether that cell was discarded.

## $pbmc3k
##    Mode   FALSE    TRUE 
## logical    2609      91 
## 
## $pbmc4k
##    Mode   FALSE    TRUE 
## logical    4182     158 
## 
## $pbmc8k
##    Mode   FALSE    TRUE 
## logical    8157     224

7.4 Normalization

We perform library size normalization, simply for convenience when dealing with file-backed matrices.

## $pbmc3k
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   0.234   0.748   0.926   1.000   1.157   6.604 
## 
## $pbmc4k
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   0.315   0.711   0.890   1.000   1.127  11.027 
## 
## $pbmc8k
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   0.296   0.704   0.877   1.000   1.118   6.794

7.6 Dimensionality reduction

For various reasons, we will first analyze each PBMC dataset separately rather than merging them together. We use randomized SVD, which is more efficient for file-backed matrices.

7.7 Clustering

## $pbmc3k
## 
##   1   2   3   4   5   6   7   8   9  10 
## 487 154 603 514  31 150 179 333 147  11 
## 
## $pbmc4k
## 
##    1    2    3    4    5    6    7    8    9   10   11   12   13 
##  497  185  569  786  373  232   44 1023   77  218   88   54   36 
## 
## $pbmc8k
## 
##    1    2    3    4    5    6    7    8    9   10   11   12   13   14   15   16 
## 1004  759 1073 1543  367  150  201 2067   59  154  244   67   76  285   20   15 
##   17   18 
##   64    9
Obligatory $t$-SNE plots of each PBMC dataset, where each point represents a cell in the corresponding dataset and is colored according to the assigned cluster.

Figure 7.3: Obligatory \(t\)-SNE plots of each PBMC dataset, where each point represents a cell in the corresponding dataset and is colored according to the assigned cluster.

7.8 Data integration

With the per-dataset analyses out of the way, we will now repeat the analysis after merging together the three batches.

We use the percentage of lost variance as a diagnostic measure.

##         pbmc3k    pbmc4k   pbmc8k
## [1,] 7.003e-03 3.126e-03 0.000000
## [2,] 7.137e-05 5.125e-05 0.003003

We proceed to clustering:

##     
##      pbmc3k pbmc4k pbmc8k
##   1     523    405    826
##   2     327    588   1125
##   3     185    122    218
##   4     150    180    293
##   5     172    340    577
##   6     283    533   1002
##   7     346    638   1203
##   8     433    749   1533
##   9      17     27    111
##   10    112    387    832
##   11     34    120    204
##   12     11     54    160
##   13     12      3      9
##   14      4     36     64

And visualization:

Obligatory $t$-SNE plots for the merged PBMC datasets, where each point represents a cell and is colored by cluster (top) or batch (bottom).

Figure 7.4: Obligatory \(t\)-SNE plots for the merged PBMC datasets, where each point represents a cell and is colored by cluster (top) or batch (bottom).

Session Info

R version 4.2.0 RC (2022-04-21 r82226)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.4 LTS

Matrix products: default
BLAS:   /home/biocbuild/bbs-3.16-bioc/R/lib/libRblas.so
LAPACK: /home/biocbuild/bbs-3.16-bioc/R/lib/libRlapack.so

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] batchelor_1.13.0            BiocSingular_1.13.0        
 [3] scran_1.25.0                scater_1.25.1              
 [5] ggplot2_3.3.6               scuttle_1.7.2              
 [7] TENxPBMCData_1.15.0         HDF5Array_1.25.0           
 [9] rhdf5_2.41.0                DelayedArray_0.23.0        
[11] Matrix_1.4-1                SingleCellExperiment_1.19.0
[13] SummarizedExperiment_1.27.1 Biobase_2.57.1             
[15] GenomicRanges_1.49.0        GenomeInfoDb_1.33.3        
[17] IRanges_2.31.0              S4Vectors_0.35.0           
[19] BiocGenerics_0.43.0         MatrixGenerics_1.9.0       
[21] matrixStats_0.62.0          BiocStyle_2.25.0           
[23] rebook_1.7.0               

loaded via a namespace (and not attached):
  [1] AnnotationHub_3.5.0           BiocFileCache_2.5.0          
  [3] igraph_1.3.1                  BiocParallel_1.31.4          
  [5] digest_0.6.29                 htmltools_0.5.2              
  [7] viridis_0.6.2                 fansi_1.0.3                  
  [9] magrittr_2.0.3                memoise_2.0.1                
 [11] ScaledMatrix_1.5.0            cluster_2.1.3                
 [13] limma_3.53.2                  Biostrings_2.65.0            
 [15] colorspace_2.0-3              blob_1.2.3                   
 [17] rappdirs_0.3.3                ggrepel_0.9.1                
 [19] xfun_0.31                     dplyr_1.0.9                  
 [21] crayon_1.5.1                  RCurl_1.98-1.6               
 [23] jsonlite_1.8.0                graph_1.75.0                 
 [25] glue_1.6.2                    gtable_0.3.0                 
 [27] zlibbioc_1.43.0               XVector_0.37.0               
 [29] Rhdf5lib_1.19.2               scales_1.2.0                 
 [31] DBI_1.1.2                     edgeR_3.39.1                 
 [33] Rcpp_1.0.8.3                  viridisLite_0.4.0            
 [35] xtable_1.8-4                  dqrng_0.3.0                  
 [37] bit_4.0.4                     rsvd_1.0.5                   
 [39] ResidualMatrix_1.7.0          metapod_1.5.0                
 [41] httr_1.4.3                    FNN_1.1.3                    
 [43] dir.expiry_1.5.0              ellipsis_0.3.2               
 [45] pkgconfig_2.0.3               XML_3.99-0.9                 
 [47] farver_2.1.0                  uwot_0.1.11                  
 [49] CodeDepends_0.6.5             sass_0.4.1                   
 [51] dbplyr_2.1.1                  locfit_1.5-9.5               
 [53] utf8_1.2.2                    tidyselect_1.1.2             
 [55] labeling_0.4.2                rlang_1.0.2                  
 [57] later_1.3.0                   AnnotationDbi_1.59.1         
 [59] munsell_0.5.0                 BiocVersion_3.16.0           
 [61] tools_4.2.0                   cachem_1.0.6                 
 [63] cli_3.3.0                     generics_0.1.2               
 [65] RSQLite_2.2.14                ExperimentHub_2.5.0          
 [67] evaluate_0.15                 stringr_1.4.0                
 [69] fastmap_1.1.0                 yaml_2.3.5                   
 [71] knitr_1.39                    bit64_4.0.5                  
 [73] purrr_0.3.4                   KEGGREST_1.37.0              
 [75] sparseMatrixStats_1.9.0       mime_0.12                    
 [77] compiler_4.2.0                beeswarm_0.4.0               
 [79] filelock_1.0.2                curl_4.3.2                   
 [81] png_0.1-7                     interactiveDisplayBase_1.35.0
 [83] tibble_3.1.7                  statmod_1.4.36               
 [85] bslib_0.3.1                   stringi_1.7.6                
 [87] highr_0.9                     RSpectra_0.16-1              
 [89] lattice_0.20-45               bluster_1.7.0                
 [91] vctrs_0.4.1                   pillar_1.7.0                 
 [93] lifecycle_1.0.1               rhdf5filters_1.9.0           
 [95] BiocManager_1.30.18           jquerylib_0.1.4              
 [97] RcppAnnoy_0.0.19              BiocNeighbors_1.15.0         
 [99] cowplot_1.1.1                 bitops_1.0-7                 
[101] irlba_2.3.5                   httpuv_1.6.5                 
[103] R6_2.5.1                      bookdown_0.26                
[105] promises_1.2.0.1              gridExtra_2.3                
[107] vipor_0.4.5                   codetools_0.2-18             
[109] assertthat_0.2.1              withr_2.5.0                  
[111] GenomeInfoDbData_1.2.8        parallel_4.2.0               
[113] grid_4.2.0                    beachmat_2.13.0              
[115] rmarkdown_2.14                DelayedMatrixStats_1.19.0    
[117] Rtsne_0.16                    shiny_1.7.1                  
[119] ggbeeswarm_0.6.0             

References

Zheng, G. X., J. M. Terry, P. Belgrader, P. Ryvkin, Z. W. Bent, R. Wilson, S. B. Ziraldo, et al. 2017. “Massively parallel digital transcriptional profiling of single cells.” Nat Commun 8 (January): 14049.