Chapter 3 Unfiltered human PBMCs (10X Genomics)
3.1 Introduction
Here, we describe a brief analysis of the peripheral blood mononuclear cell (PBMC) dataset from 10X Genomics (Zheng et al. 2017). The data are publicly available from the 10X Genomics website, from which we download the raw gene/barcode count matrices, i.e., before cell calling from the CellRanger pipeline.
3.2 Data loading
3.3 Quality control
We perform cell detection using the emptyDrops()
algorithm, as discussed in Advanced Section 7.2.
set.seed(100)
e.out <- emptyDrops(counts(sce.pbmc))
sce.pbmc <- sce.pbmc[,which(e.out$FDR <= 0.001)]
We use a relaxed QC strategy and only remove cells with large mitochondrial proportions, using it as a proxy for cell damage. This reduces the risk of removing cell types with low RNA content, especially in a heterogeneous PBMC population with many different cell types.
stats <- perCellQCMetrics(sce.pbmc, subsets=list(Mito=which(location=="MT")))
high.mito <- isOutlier(stats$subsets_Mito_percent, type="higher")
sce.pbmc <- sce.pbmc[,!high.mito]
## Mode FALSE TRUE
## logical 3951 313
colData(unfiltered) <- cbind(colData(unfiltered), stats)
unfiltered$discard <- high.mito
gridExtra::grid.arrange(
plotColData(unfiltered, y="sum", colour_by="discard") +
scale_y_log10() + ggtitle("Total count"),
plotColData(unfiltered, y="detected", colour_by="discard") +
scale_y_log10() + ggtitle("Detected features"),
plotColData(unfiltered, y="subsets_Mito_percent",
colour_by="discard") + ggtitle("Mito percent"),
ncol=2
)
3.4 Normalization
library(scran)
set.seed(1000)
clusters <- quickCluster(sce.pbmc)
sce.pbmc <- computeSumFactors(sce.pbmc, cluster=clusters)
sce.pbmc <- logNormCounts(sce.pbmc)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 0.007 0.717 0.878 1.000 1.102 11.504
plot(librarySizeFactors(sce.pbmc), sizeFactors(sce.pbmc), pch=16,
xlab="Library size factors", ylab="Deconvolution factors", log="xy")
3.5 Variance modelling
set.seed(1001)
dec.pbmc <- modelGeneVarByPoisson(sce.pbmc)
top.pbmc <- getTopHVGs(dec.pbmc, prop=0.1)
plot(dec.pbmc$mean, dec.pbmc$total, pch=16, cex=0.5,
xlab="Mean of log-expression", ylab="Variance of log-expression")
curfit <- metadata(dec.pbmc)
curve(curfit$trend(x), col='dodgerblue', add=TRUE, lwd=2)
3.6 Dimensionality reduction
set.seed(10000)
sce.pbmc <- denoisePCA(sce.pbmc, subset.row=top.pbmc, technical=dec.pbmc)
set.seed(100000)
sce.pbmc <- runTSNE(sce.pbmc, dimred="PCA")
set.seed(1000000)
sce.pbmc <- runUMAP(sce.pbmc, dimred="PCA")
We verify that a reasonable number of PCs is retained.
## [1] 9
3.7 Clustering
g <- buildSNNGraph(sce.pbmc, k=10, use.dimred = 'PCA')
clust <- igraph::cluster_walktrap(g)$membership
colLabels(sce.pbmc) <- factor(clust)
##
## 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
## 202 590 523 780 55 359 126 753 46 151 144 77 82 25 17 21
3.8 Interpretation
We examine the markers for cluster 4 in more detail. High expression of CD14, CD68 and MNDA combined with low expression of FCGR3A (CD16) suggests that this cluster contains monocytes, compared to macrophages in cluster 13 (Figure 3.6).
## p.value FDR summary.logFC
## MNDA 0.000e+00 3.953e-323 2.4130
## RP11-1143G9.4 1.401e-283 2.360e-279 2.6731
## FCN1 1.047e-269 1.176e-265 2.6884
## CSTA 8.279e-264 6.974e-260 2.2625
## VCAN 1.396e-249 9.405e-246 1.8120
## S100A12 1.765e-212 9.911e-209 2.3921
## FGL2 1.538e-207 7.401e-204 1.4542
## LGALS2 2.310e-193 9.729e-190 1.9884
## MS4A6A 3.077e-192 1.152e-188 1.4849
## CFD 3.427e-182 1.155e-178 1.4380
## CD14 2.440e-175 7.475e-172 1.3140
## CLEC7A 3.806e-174 1.069e-170 1.0823
## SERPINA1 6.175e-168 1.600e-164 1.4856
## AIF1 1.025e-167 2.467e-164 2.6619
## KLF4 5.359e-158 1.204e-154 1.1672
## TYMP 1.348e-156 2.840e-153 2.0407
## CFP 5.317e-146 1.054e-142 1.1002
## NAMPT 4.321e-141 8.089e-138 1.0566
## IFI30 1.402e-139 2.486e-136 0.9611
## CD68 3.187e-136 5.369e-133 1.1208
## MPEG1 4.107e-135 6.589e-132 0.9498
## CYBB 9.544e-133 1.462e-129 1.1915
## LGALS3 5.012e-132 7.343e-129 0.9240
## TNFSF13B 9.896e-130 1.389e-126 1.0572
## CPVL 2.309e-122 3.112e-119 0.8207
## CSF3R 2.155e-120 2.793e-117 0.8046
## CD302 2.855e-118 3.562e-115 0.8382
## CTSS 1.026e-115 1.235e-112 3.2502
## BLVRB 1.097e-114 1.275e-111 0.9200
## GRN 1.043e-113 1.171e-110 1.4442
plotExpression(sce.pbmc, features=c("CD14", "CD68",
"MNDA", "FCGR3A"), x="label", colour_by="label")
Session Info
R Under development (unstable) (2024-10-21 r87258)
Platform: x86_64-pc-linux-gnu
Running under: Ubuntu 24.04.1 LTS
Matrix products: default
BLAS: /home/biocbuild/bbs-3.21-bioc/R/lib/libRblas.so
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.12.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
time zone: America/New_York
tzcode source: system (glibc)
attached base packages:
[1] stats4 stats graphics grDevices utils datasets methods
[8] base
other attached packages:
[1] scran_1.35.0 EnsDb.Hsapiens.v86_2.99.0
[3] ensembldb_2.31.0 AnnotationFilter_1.31.0
[5] GenomicFeatures_1.59.1 AnnotationDbi_1.69.0
[7] scater_1.35.0 ggplot2_3.5.1
[9] scuttle_1.17.0 DropletUtils_1.27.2
[11] SingleCellExperiment_1.29.1 SummarizedExperiment_1.37.0
[13] Biobase_2.67.0 GenomicRanges_1.59.1
[15] GenomeInfoDb_1.43.2 IRanges_2.41.2
[17] S4Vectors_0.45.2 BiocGenerics_0.53.3
[19] generics_0.1.3 MatrixGenerics_1.19.1
[21] matrixStats_1.5.0 DropletTestFiles_1.17.0
[23] BiocStyle_2.35.0 rebook_1.17.0
loaded via a namespace (and not attached):
[1] jsonlite_1.8.9 CodeDepends_0.6.6
[3] magrittr_2.0.3 ggbeeswarm_0.7.2
[5] farver_2.1.2 rmarkdown_2.29
[7] BiocIO_1.17.1 vctrs_0.6.5
[9] memoise_2.0.1 Rsamtools_2.23.1
[11] DelayedMatrixStats_1.29.1 RCurl_1.98-1.16
[13] htmltools_0.5.8.1 S4Arrays_1.7.1
[15] AnnotationHub_3.15.0 curl_6.1.0
[17] BiocNeighbors_2.1.2 Rhdf5lib_1.29.0
[19] SparseArray_1.7.2 rhdf5_2.51.2
[21] sass_0.4.9 bslib_0.8.0
[23] cachem_1.1.0 GenomicAlignments_1.43.0
[25] igraph_2.1.3 mime_0.12
[27] lifecycle_1.0.4 pkgconfig_2.0.3
[29] rsvd_1.0.5 Matrix_1.7-1
[31] R6_2.5.1 fastmap_1.2.0
[33] GenomeInfoDbData_1.2.13 digest_0.6.37
[35] colorspace_2.1-1 dqrng_0.4.1
[37] irlba_2.3.5.1 ExperimentHub_2.15.0
[39] RSQLite_2.3.9 beachmat_2.23.6
[41] labeling_0.4.3 filelock_1.0.3
[43] httr_1.4.7 abind_1.4-8
[45] compiler_4.5.0 bit64_4.5.2
[47] withr_3.0.2 BiocParallel_1.41.0
[49] viridis_0.6.5 DBI_1.2.3
[51] HDF5Array_1.35.3 R.utils_2.12.3
[53] rappdirs_0.3.3 DelayedArray_0.33.3
[55] bluster_1.17.0 rjson_0.2.23
[57] tools_4.5.0 vipor_0.4.7
[59] beeswarm_0.4.0 R.oo_1.27.0
[61] glue_1.8.0 restfulr_0.0.15
[63] rhdf5filters_1.19.0 grid_4.5.0
[65] Rtsne_0.17 cluster_2.1.8
[67] gtable_0.3.6 R.methodsS3_1.8.2
[69] metapod_1.15.0 BiocSingular_1.23.0
[71] ScaledMatrix_1.15.0 XVector_0.47.2
[73] ggrepel_0.9.6 BiocVersion_3.21.1
[75] pillar_1.10.1 limma_3.63.3
[77] dplyr_1.1.4 BiocFileCache_2.15.0
[79] lattice_0.22-6 FNN_1.1.4.1
[81] rtracklayer_1.67.0 bit_4.5.0.1
[83] tidyselect_1.2.1 locfit_1.5-9.10
[85] Biostrings_2.75.3 knitr_1.49
[87] gridExtra_2.3 bookdown_0.42
[89] ProtGenerics_1.39.1 edgeR_4.5.1
[91] xfun_0.50 statmod_1.5.0
[93] UCSC.utils_1.3.0 lazyeval_0.2.2
[95] yaml_2.3.10 evaluate_1.0.3
[97] codetools_0.2-20 tibble_3.2.1
[99] BiocManager_1.30.25 graph_1.85.1
[101] cli_3.6.3 uwot_0.2.2
[103] munsell_0.5.1 jquerylib_0.1.4
[105] Rcpp_1.0.14 dir.expiry_1.15.0
[107] dbplyr_2.5.0 png_0.1-8
[109] XML_3.99-0.18 parallel_4.5.0
[111] blob_1.2.4 sparseMatrixStats_1.19.0
[113] bitops_1.0-9 viridisLite_0.4.2
[115] scales_1.3.0 purrr_1.0.2
[117] crayon_1.5.3 rlang_1.1.4
[119] cowplot_1.1.3 KEGGREST_1.47.0