Chapter 34 Merged human pancreas datasets

34.1 Introduction

For a period in 2016, there was a great deal of interest in using scRNA-seq to profile the human pancreas at cellular resolution (Muraro et al. 2016; Grun et al. 2016; Lawlor et al. 2017; Segerstolpe et al. 2016). As a consequence, we have a surplus of human pancreas datasets generated by different authors with different technologies, which provides an ideal use case for demonstrating more complex data integration strategies. This represents a more challenging application than the PBMC dataset in Chapter 13 as it involves different sequencing protocols and different patients, most likely with differences in cell type composition.

34.2 The good

We start by considering only two datasets from Muraro et al. (2016) and Grun et al. (2016). This is a relatively simple scenario involving very similar protocols (CEL-seq and CEL-seq2) and a similar set of authors.

## class: SingleCellExperiment 
## dim: 17474 1063 
## metadata(0):
## assays(2): counts logcounts
## rownames(17474): ENSG00000268895 ENSG00000121410 ... ENSG00000074755
##   ENSG00000036549
## rowData names(2): symbol chr
## colnames(1063): D2ex_1 D2ex_2 ... D17TGFB_94 D17TGFB_95
## colData names(3): donor sample sizeFactor
## reducedDimNames(0):
## altExpNames(1): ERCC
## class: SingleCellExperiment 
## dim: 16940 2299 
## metadata(0):
## assays(2): counts logcounts
## rownames(16940): ENSG00000268895 ENSG00000121410 ... ENSG00000159840
##   ENSG00000074755
## rowData names(2): symbol chr
## colnames(2299): D28-1_1 D28-1_2 ... D30-8_93 D30-8_94
## colData names(4): label donor plate sizeFactor
## reducedDimNames(0):
## altExpNames(1): ERCC

We subset both batches to their common universe of genes; adjust their scaling to equalize sequencing coverage (not really necessary in this case, as the coverage is already similar, but we will do so anyway for consistency); and select those genes with positive average biological components for further use.

We observe that rescaleBatches() is unable to align cells from different batches in Figure 34.1. This is attributable to differences in population composition between batches, with additional complications from non-linearities in the batch effect, e.g., when the magnitude or direction of the batch effect differs between cell types.

$t$-SNE plot of the two pancreas datasets after correction with `rescaleBatches()`. Each point represents a cell and is colored according to the batch of origin.

Figure 34.1: \(t\)-SNE plot of the two pancreas datasets after correction with rescaleBatches(). Each point represents a cell and is colored according to the batch of origin.

Here, we use fastMNN() to merge together the two human pancreas datasets described earlier. Clustering on the merged datasets yields fewer batch-specific clusters, which is recapitulated as greater intermingling between batches in Figure 34.2. This improvement over Figure 34.1 represents the ability of fastMNN() to adapt to more complex situations involving differences in population composition between batches.

##        Batch
## Cluster   1   2
##      1  243 280
##      2  315 255
##      3  203 843
##      4   56 194
##      5   24 108
##      6  116 398
##      7   27   0
##      8   56  72
##      9   18 113
##      10   0  17
##      11   5  19
$t$-SNE plot of the two pancreas datasets after correction with `fastMNN()`. Each point represents a cell and is colored according to the batch of origin.

Figure 34.2: \(t\)-SNE plot of the two pancreas datasets after correction with fastMNN(). Each point represents a cell and is colored according to the batch of origin.

34.3 The bad

Flushed with our previous success, we now attempt to merge the other datasets from Lawlor et al. (2017) and Segerstolpe et al. (2016). This is a more challenging task as it involves different technologies, mixtures of UMI and read count data and a more diverse set of authors (presumably with greater differences in the patient population).

## class: SingleCellExperiment 
## dim: 26616 604 
## metadata(0):
## assays(2): counts logcounts
## rownames(26616): ENSG00000229483 ENSG00000232849 ... ENSG00000251576
##   ENSG00000082898
## rowData names(2): SYMBOL SEQNAME
## colnames(604): 10th_C11_S96 10th_C13_S61 ... 9th-C96_S81 9th-C9_S13
## colData names(9): title age ... Sex sizeFactor
## reducedDimNames(0):
## altExpNames(0):
#--- loading ---#
library(scRNAseq)
sce.seger <- SegerstolpePancreasData()

#--- gene-annotation ---#
library(AnnotationHub)
edb <- AnnotationHub()[["AH73881"]]
symbols <- rowData(sce.seger)$symbol
ens.id <- mapIds(edb, keys=symbols, keytype="SYMBOL", column="GENEID")
ens.id <- ifelse(is.na(ens.id), symbols, ens.id)

# Removing duplicated rows.
keep <- !duplicated(ens.id)
sce.seger <- sce.seger[keep,]
rownames(sce.seger) <- ens.id[keep]

#--- sample-annotation ---#
emtab.meta <- colData(sce.seger)[,c("cell type", "disease",
    "individual", "single cell well quality")]
colnames(emtab.meta) <- c("CellType", "Disease", "Donor", "Quality")
colData(sce.seger) <- emtab.meta

sce.seger$CellType <- gsub(" cell", "", sce.seger$CellType)
sce.seger$CellType <- paste0(
    toupper(substr(sce.seger$CellType, 1, 1)),
    substring(sce.seger$CellType, 2))

#--- quality-control ---#
low.qual <- sce.seger$Quality == "low quality cell"

library(scater)
stats <- perCellQCMetrics(sce.seger)
qc <- quickPerCellQC(stats, percent_subsets="altexps_ERCC_percent",
    batch=sce.seger$Donor,
    subset=!sce.seger$Donor %in% c("HP1504901", "HP1509101"))

sce.seger <- sce.seger[,!(qc$discard | low.qual)]

#--- normalization ---#
library(scran)
clusters <- quickCluster(sce.seger)
sce.seger <- computeSumFactors(sce.seger, clusters=clusters)
sce.seger <- logNormCounts(sce.seger) 

#--- variance-modelling ---#
for.hvg <- sce.seger[,librarySizeFactors(altExp(sce.seger)) > 0 & sce.seger$Donor!="AZ"]
dec.seger <- modelGeneVarWithSpikes(for.hvg, "ERCC", block=for.hvg$Donor)
chosen.hvgs <- getTopHVGs(dec.seger, n=2000)
## class: SingleCellExperiment 
## dim: 25454 2090 
## metadata(0):
## assays(2): counts logcounts
## rownames(25454): ENSG00000118473 ENSG00000142920 ... ENSG00000278306
##   eGFP
## rowData names(2): symbol refseq
## colnames(2090): HP1502401_H13 HP1502401_J14 ... HP1526901T2D_N8
##   HP1526901T2D_A8
## colData names(5): CellType Disease Donor Quality sizeFactor
## reducedDimNames(0):
## altExpNames(1): ERCC

We perform the usual routine to obtain re-normalized values and a set of HVGs. Here, we put all the objects into a list to avoid having to explicitly type their names separately.

We observe that the merge is generally successful, with many clusters containing contributions from each batch (Figure 34.3). There are few clusters that are specific to the Segerstolpe dataset, and if we were naive, we might consider them to represent interesting subpopulations that are not present in the other datasets.

##        Batch
## Cluster Grun Lawlor Muraro Seger
##      1   304     28    256   383
##      2   103    244    382   174
##      3     0      0      0    55
##      4   219     16    241   140
##      5   166    231    357   149
##      6    34      0      1     0
##      7    56     17    196   109
##      8    70      9     80    11
##      9    28      6     39    50
##      10   24     18    107    55
##      11   35      6    483   171
##      12    0      0      0   118
##      13    0      1     16     4
##      14   18     18    117   158
##      15    0      0      0    26
##      16    1      2      5    11
##      17    0      0      0    47
##      18    0      0      0   196
##      19    0      0      0   185
##      20    5      8     19    17
##      21    0      0      0    31
$t$-SNE plots of the four pancreas datasets after correction with `fastMNN()`. Each point represents a cell and is colored according to the batch of origin (left) or the assigned cluster (right). The cluster label is shown at the median location across all cells in the cluster.

Figure 34.3: \(t\)-SNE plots of the four pancreas datasets after correction with fastMNN(). Each point represents a cell and is colored according to the batch of origin (left) or the assigned cluster (right). The cluster label is shown at the median location across all cells in the cluster.

Fortunately, we are battle-hardened and cynical, so we are sure to check for other sources of variation. The most obvious candidate is the donor of origin for each cell (Figure 34.4), which correlates strongly to these Segerstolpe-only clusters. This is not surprising given the large differences between humans in the wild, but donor-level variation is not interesting for the purposes of cell type characterization. (That said, preservation of the within-dataset donor effects is the technically correct course of action here, as a batch correction method should try to avoid removing heterogeneity within each of its defined batches.)

$t$-SNE plots of the four pancreas datasets after correction with `fastMNN()`. Each point represents a cell and is colored according to the donor of origin for the Segerstolpe dataset.

Figure 34.4: \(t\)-SNE plots of the four pancreas datasets after correction with fastMNN(). Each point represents a cell and is colored according to the donor of origin for the Segerstolpe dataset.

34.4 The ugly

Given these results, the most prudent course of action is to remove the donor effects within each dataset in addition to the batch effects across datasets. This involves a bit more work to properly specify the two levels of unwanted heterogeneity. To make our job a bit easier, we use the noCorrect() utility to combine all batches into a single SingleCellExperiment object.

We then call fastMNN() on the combined object with our chosen HVGs, using the batch= argument to specify which cells belong to which donors. This will progressively merge cells from each donor in each batch until all cells are mapped onto a common coordinate space. For some extra sophistication, we also set the weights= argument to ensure that each batch contributes equally to the PCA, regardless of the number of donors present in that batch; see ?multiBatchPCA for more details.

## $Grun
## [1] "D2"  "D3"  "D7"  "D10" "D17"
## 
## $Lawlor
## [1] "ACIW009"  "ACJV399"  "ACCG268"  "ACCR015A" "ACEK420A" "ACEL337"  "ACHY057" 
## [8] "ACIB065" 
## 
## $Muraro
## [1] "D28" "D29" "D31" "D30"
## 
## $Seger
##  [1] "HP1502401"    "HP1504101T2D" "AZ"           "HP1508501T2D" "HP1506401"   
##  [6] "HP1507101"    "HP1509101"    "HP1504901"    "HP1525301T2D" "HP1526901T2D"

With this approach, we see that the Segerstolpe-only clusters have disappeared (Figure 34.5). Visually, there also seems to be much greater mixing between cells from different Segerstolpe donors. This suggests that we have removed most of the donor effect, which simplifies the interpretation of our clusters.

##         
## clusters Grun Lawlor Muraro Seger
##        1  247     20    278   186
##        2  338     26    257   387
##        3  171    250    453   267
##        4  202    245    857   891
##        5   57     17    193   108
##        6   24     17    108    55
##        7    5      9     19    17
##        8    0      1     17     4
##        9   19     19    117   175
$t$-SNE plots of the four pancreas datasets after donor-level correction with `fastMNN()`. Each point represents a cell and is colored according to the batch of origin (left) or the donor of origin for the Segerstolpe-derived cells (right). The cluster label is shown at the median location across all cells in the cluster.

Figure 34.5: \(t\)-SNE plots of the four pancreas datasets after donor-level correction with fastMNN(). Each point represents a cell and is colored according to the batch of origin (left) or the donor of origin for the Segerstolpe-derived cells (right). The cluster label is shown at the median location across all cells in the cluster.

Our clusters compare well to the published annotations, indicating that we did not inadvertently discard important factors of variation during correction. (Though in this case, the cell types are so well defined, it would be quite a feat to fail to separate them!)

##                         clusters
## proposed                    1    2    3    4    5    6    7    8    9
##   acinar                  421    1    0    2    0    0    1    0    0
##   alpha                     1    7    4 1871    1    0    1    0    2
##   beta                      3    4  917    5    0    2    1    1    7
##   co-expression             0    0   17   22    0    0    0    0    0
##   delta                     0    2    3    3  306    0    1    0    1
##   ductal                    6  612    4    1    0    6    0   10    1
##   endothelial               0    0    0    0    0    1   33    0    0
##   epsilon                   0    0    0    2    0    0    0    0    6
##   gamma                     2    0    0    0    0    0    0    0  280
##   mesenchymal               0    1    0    0    0   79    0    0    0
##   mhc class ii              0    0    0    0    0    0    0    4    0
##   nana                      2    8    1   13    1    0    1    0    0
##   none/other                0    3    1    2    0    0    4    1    1
##   stellate                  0    0    0    1    0   70    1    0    0
##   unclassified              0    0    0    0    0    2    0    0    0
##   unclassified endocrine    0    0    2    4    0    0    0    0    0
##   unclear                   0    4    0    0    0    0    0    0    0

Session Info

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               scater_1.18.0              
 [3] ggplot2_3.3.2               scran_1.18.0               
 [5] batchelor_1.6.0             SingleCellExperiment_1.12.0
 [7] SummarizedExperiment_1.20.0 Biobase_2.50.0             
 [9] GenomicRanges_1.42.0        GenomeInfoDb_1.26.0        
[11] IRanges_2.24.0              S4Vectors_0.28.0           
[13] BiocGenerics_0.36.0         MatrixGenerics_1.2.0       
[15] matrixStats_0.57.0          BiocStyle_2.18.0           
[17] rebook_1.0.0               

loaded via a namespace (and not attached):
 [1] bitops_1.0-6              tools_4.0.3              
 [3] R6_2.5.0                  irlba_2.3.3              
 [5] ResidualMatrix_1.0.0      vipor_0.4.5              
 [7] colorspace_1.4-1          withr_2.3.0              
 [9] tidyselect_1.1.0          gridExtra_2.3            
[11] processx_3.4.4            compiler_4.0.3           
[13] graph_1.68.0              BiocNeighbors_1.8.0      
[15] DelayedArray_0.16.0       labeling_0.4.2           
[17] bookdown_0.21             scales_1.1.1             
[19] callr_3.5.1               stringr_1.4.0            
[21] digest_0.6.27             rmarkdown_2.5            
[23] XVector_0.30.0            pkgconfig_2.0.3          
[25] htmltools_0.5.0           sparseMatrixStats_1.2.0  
[27] highr_0.8                 limma_3.46.0             
[29] rlang_0.4.8               DelayedMatrixStats_1.12.0
[31] generics_0.1.0            farver_2.0.3             
[33] BiocParallel_1.24.0       dplyr_1.0.2              
[35] RCurl_1.98-1.2            magrittr_1.5             
[37] BiocSingular_1.6.0        GenomeInfoDbData_1.2.4   
[39] scuttle_1.0.0             Matrix_1.2-18            
[41] Rcpp_1.0.5                ggbeeswarm_0.6.0         
[43] munsell_0.5.0             viridis_0.5.1            
[45] lifecycle_0.2.0           stringi_1.5.3            
[47] yaml_2.2.1                edgeR_3.32.0             
[49] zlibbioc_1.36.0           Rtsne_0.15               
[51] grid_4.0.3                dqrng_0.2.1              
[53] crayon_1.3.4              lattice_0.20-41          
[55] cowplot_1.1.0             beachmat_2.6.0           
[57] locfit_1.5-9.4            CodeDepends_0.6.5        
[59] knitr_1.30                ps_1.4.0                 
[61] pillar_1.4.6              igraph_1.2.6             
[63] codetools_0.2-16          XML_3.99-0.5             
[65] glue_1.4.2                evaluate_0.14            
[67] BiocManager_1.30.10       vctrs_0.3.4              
[69] gtable_0.3.0              purrr_0.3.4              
[71] xfun_0.19                 rsvd_1.0.3               
[73] viridisLite_0.3.0         tibble_3.0.4             
[75] beeswarm_0.2.3            statmod_1.4.35           
[77] ellipsis_0.3.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.

Lawlor, N., J. George, M. Bolisetty, R. Kursawe, L. Sun, V. Sivakamasundari, I. Kycia, P. Robson, and M. L. Stitzel. 2017. “Single-cell transcriptomes identify human islet cell signatures and reveal cell-type-specific expression changes in type 2 diabetes.” Genome Res. 27 (2): 208–22.

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.

Segerstolpe, A., A. Palasantza, P. Eliasson, E. M. Andersson, A. C. Andreasson, X. Sun, S. Picelli, et al. 2016. “Single-Cell Transcriptome Profiling of Human Pancreatic Islets in Health and Type 2 Diabetes.” Cell Metab. 24 (4): 593–607.