Chapter 8 Cross-annotating human pancreas

8.1 Loading the data

We load the Muraro et al. (2016) dataset as our reference, removing unlabelled cells or cells without a clear label.

We compute log-expression values for use in marker detection inside SingleR().

We examine the distribution of labels in this reference.

## 
##      acinar       alpha        beta       delta        duct endothelial 
##         219         812         448         193         245          21 
##     epsilon mesenchymal          pp 
##           3          80         101

We load the Grun et al. (2016) dataset as our test, applying some basic quality control to remove low-quality cells in some of the batches (see here for details).

Technically speaking, the test dataset does not need log-expression values but we compute them anyway for convenience.

8.2 Applying the annotation

We apply SingleR() with Wilcoxon rank sum test-based marker detection to annotate the Grun dataset with the Muraro labels.

We examine the distribution of predicted labels:

## 
##      acinar       alpha        beta       delta        duct endothelial 
##         277         203         181          50         306           5 
##     epsilon mesenchymal          pp 
##           1          22          19

We can also examine the number of discarded cells for each label:

##              Lost
## Label         FALSE TRUE
##   acinar        251   26
##   alpha         198    5
##   beta          180    1
##   delta          49    1
##   duct          301    5
##   endothelial     4    1
##   epsilon         1    0
##   mesenchymal    22    0
##   pp             17    2

8.3 Diagnostics

We visualize the assignment scores for each label in Figure 8.1.

Heatmap of the (normalized) assignment scores for each cell (column) in the Grun test dataset with respect to each label (row) in the Muraro reference dataset. The final assignment for each cell is shown in the annotation bar at the top.

Figure 8.1: Heatmap of the (normalized) assignment scores for each cell (column) in the Grun test dataset with respect to each label (row) in the Muraro reference dataset. The final assignment for each cell is shown in the annotation bar at the top.

The delta for each cell is visualized in Figure 8.2.

Distributions of the deltas for each cell in the Grun dataset assigned to each label in the Muraro dataset. Each cell is represented by a point; low-quality assignments that were pruned out are colored in orange.

Figure 8.2: Distributions of the deltas for each cell in the Grun dataset assigned to each label in the Muraro dataset. Each cell is represented by a point; low-quality assignments that were pruned out are colored in orange.

Finally, we visualize the heatmaps of the marker genes for each label in Figure 8.3.

Heatmaps of log-expression values in the Grun dataset for all marker genes upregulated in each label in the Muraro reference dataset. Assigned labels for each cell are shown at the top of each plot.

Figure 8.3: Heatmaps of log-expression values in the Grun dataset for all marker genes upregulated in each label in the Muraro reference dataset. Assigned labels for each cell are shown at the top of each plot.

8.4 Comparison to clusters

For comparison, we will perform a quick unsupervised analysis of the Grun dataset. We model the variances using the spike-in data and we perform graph-based clustering (increasing the resolution by dropping k=5).

We see that the clusters map reasonably well to the labels in Figure 8.4.

Heatmap of the log-transformed number of cells in each combination of label (column) and cluster (row) in the Grun dataset.

Figure 8.4: Heatmap of the log-transformed number of cells in each combination of label (column) and cluster (row) in the Grun dataset.

We proceed to the most important part of the analysis. Yes, that’s right, the \(t\)-SNE plot (Figure 8.5).

$t$-SNE plot of the Grun dataset, where each point is a cell and is colored by the assigned cluster. Reference labels from the Muraro dataset are also placed on the median coordinate across all cells assigned with that label.

Figure 8.5: \(t\)-SNE plot of the Grun dataset, where each point is a cell and is colored by the assigned cluster. Reference labels from the Muraro dataset are also placed on the median coordinate across all cells assigned with that label.

Session information

R version 4.0.3 (2020-10-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.1 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] bluster_1.0.0               scran_1.18.0               
 [3] SingleR_1.4.0               scater_1.18.0              
 [5] ggplot2_3.3.2               scRNAseq_2.4.0             
 [7] SingleCellExperiment_1.12.0 SummarizedExperiment_1.20.0
 [9] Biobase_2.50.0              GenomicRanges_1.42.0       
[11] GenomeInfoDb_1.26.0         IRanges_2.24.0             
[13] S4Vectors_0.28.0            BiocGenerics_0.36.0        
[15] MatrixGenerics_1.2.0        matrixStats_0.57.0         
[17] BiocStyle_2.18.0            rebook_1.0.0               

loaded via a namespace (and not attached):
  [1] Rtsne_0.15                    ggbeeswarm_0.6.0             
  [3] colorspace_1.4-1              ellipsis_0.3.1               
  [5] scuttle_1.0.0                 XVector_0.30.0               
  [7] BiocNeighbors_1.8.0           farver_2.0.3                 
  [9] bit64_4.0.5                   interactiveDisplayBase_1.28.0
 [11] AnnotationDbi_1.52.0          xml2_1.3.2                   
 [13] codetools_0.2-16              sparseMatrixStats_1.2.0      
 [15] knitr_1.30                    Rsamtools_2.6.0              
 [17] dbplyr_1.4.4                  pheatmap_1.0.12              
 [19] graph_1.68.0                  shiny_1.5.0                  
 [21] BiocManager_1.30.10           compiler_4.0.3               
 [23] httr_1.4.2                    dqrng_0.2.1                  
 [25] assertthat_0.2.1              Matrix_1.2-18                
 [27] fastmap_1.0.1                 lazyeval_0.2.2               
 [29] limma_3.46.0                  later_1.1.0.1                
 [31] BiocSingular_1.6.0            htmltools_0.5.0              
 [33] prettyunits_1.1.1             tools_4.0.3                  
 [35] igraph_1.2.6                  rsvd_1.0.3                   
 [37] gtable_0.3.0                  glue_1.4.2                   
 [39] GenomeInfoDbData_1.2.4        dplyr_1.0.2                  
 [41] rappdirs_0.3.1                Rcpp_1.0.5                   
 [43] vctrs_0.3.4                   Biostrings_2.58.0            
 [45] ExperimentHub_1.16.0          rtracklayer_1.50.0           
 [47] DelayedMatrixStats_1.12.0     xfun_0.19                    
 [49] stringr_1.4.0                 ps_1.4.0                     
 [51] beachmat_2.6.0                mime_0.9                     
 [53] lifecycle_0.2.0               irlba_2.3.3                  
 [55] ensembldb_2.14.0              statmod_1.4.35               
 [57] XML_3.99-0.5                  edgeR_3.32.0                 
 [59] AnnotationHub_2.22.0          zlibbioc_1.36.0              
 [61] scales_1.1.1                  hms_0.5.3                    
 [63] promises_1.1.1                ProtGenerics_1.22.0          
 [65] RColorBrewer_1.1-2            AnnotationFilter_1.14.0      
 [67] yaml_2.2.1                    curl_4.3                     
 [69] gridExtra_2.3                 memoise_1.1.0                
 [71] biomaRt_2.46.0                stringi_1.5.3                
 [73] RSQLite_2.2.1                 highr_0.8                    
 [75] BiocVersion_3.12.0            GenomicFeatures_1.42.0       
 [77] BiocParallel_1.24.0           rlang_0.4.8                  
 [79] pkgconfig_2.0.3               bitops_1.0-6                 
 [81] evaluate_0.14                 lattice_0.20-41              
 [83] purrr_0.3.4                   labeling_0.4.2               
 [85] GenomicAlignments_1.26.0      CodeDepends_0.6.5            
 [87] cowplot_1.1.0                 bit_4.0.4                    
 [89] processx_3.4.4                tidyselect_1.1.0             
 [91] magrittr_1.5                  bookdown_0.21                
 [93] R6_2.5.0                      generics_0.1.0               
 [95] DelayedArray_0.16.0           DBI_1.1.0                    
 [97] pillar_1.4.6                  withr_2.3.0                  
 [99] RCurl_1.98-1.2                tibble_3.0.4                 
[101] crayon_1.3.4                  BiocFileCache_1.14.0         
[103] rmarkdown_2.5                 viridis_0.5.1                
[105] progress_1.2.2                locfit_1.5-9.4               
[107] grid_4.0.3                    blob_1.2.1                   
[109] callr_3.5.1                   digest_0.6.27                
[111] xtable_1.8-4                  httpuv_1.5.4                 
[113] openssl_1.4.3                 munsell_0.5.0                
[115] viridisLite_0.3.0             beeswarm_0.2.3               
[117] vipor_0.4.5                   askpass_1.1                  

Bibliography

Grun, D., M. J. Muraro, J. C. Boisset, K. Wiebrands, A. Lyubimova, G. Dharmadhikari, M. van den Born, et al. 2016. “De Novo Prediction of Stem Cell Identity using Single-Cell Transcriptome Data.” Cell Stem Cell 19 (2): 266–77.

Muraro, M. J., G. Dharmadhikari, D. Grun, N. Groen, T. Dielen, E. Jansen, L. van Gurp, et al. 2016. “A Single-Cell Transcriptome Atlas of the Human Pancreas.” Cell Syst 3 (4): 385–94.