MouseAgingData 0.99.1
Install the package using Bioconductor. Start R and enter:
# if(!requireNamespace("BiocManager", quietly = TRUE))
# install.packages("BiocManager")
# BiocManager::install("MouseAgingData")
Now, load the package and dependencies used in the vignette.
library(scran)
library(scater)
library(ggplot2)
library(bluster)
library(SingleCellExperiment)
library(ExperimentHub)
library(MouseAgingData)
Single-cell sequencing technology can reveal intricate details about individual cells, allowing researchers to interrogate the genetic make up of cells within a heterogeneous sample. Single-cell sequencing can provide insights into various aspects of cellular biology, such as characterization of cell populations, identification of rare cell types, and quantification of expression levels in cell types across experimental treatments. Given the wide utility, single-cell sequencing has expanded scientific knowledge various fields, including cancer research, immunology, developmental biology, neurobiology, and microbiology.
There are several methods for generating single-cell sequencing data which can extract either the DNA (scDNA-seq) or RNA (scRNA-seq) of a cell. These include, but are not limited to:
Droplet-based platforms such as 10x Genomics Chromium system, inDrop, Drop-seq, and Seq-Well, which use microfluidic devices to isolate individual cells into tiny droplets along with unique barcoded beads.
Plate or microwell-based methods such as the Smart-seq2 protocol or the C1 system by Fluidigm, respectively. These platforms employ microfluidic chips or multi-well arrays to capture and process individual cells. Unlike droplet-based platforms, these cells are manually or automatically sorted into individual wells of the plate.
The MouseAgingData
package provides analysis-ready data from an aging mouse
brain parabiosis single cell study by Ximerakis & Holton et al.,
2023. The contents of the package
can be accessed by querying ExperimentHub with the package name.
This vignette performs a simple analysis of the parabiosis 10X Genomics single-cell data set from Ximerakis & Holton et al. (2023). The analysis follows the Basics of Single-Cell Analysis in the OSCA Bioconductor book Quick Start Workflow. In this study, the authors investigated how heterochronic parabiosis affects the mouse brain in terms of aging and rejuvenation. They identified gene signatures attributed to aging in specific cell-types. They focus especially on brain endothelial cells, which showed dynamic transcriptional changes that affect vascular structure and function.
This vignette walks through the process of quality control, normalization, various forms of dimensionality reduction, clustering, detection of marker genes, and annotation of cell types. PCA, UMAP, and tSNE coordinates used in the study were provided b the authors for visualization.
The parabiosis single cell RNA-seq (Ximerakis, Holton et al Nature Aging 2023) includes 105,329 cells, 31 cell types across 8 OX, 8 YX, 7 YY, 9 YO, 7 OO, 11 OY animals, and 20905 features
sce <- parabiosis10X()
#> see ?MouseAgingData and browseVignettes('MouseAgingData') for documentation
#> downloading 1 resources
#> retrieving 1 resource
#> loading from cache
sce
#> class: SingleCellExperiment
#> dim: 20905 105329
#> metadata(1): cell_colors
#> assays(1): counts
#> rownames(20905): Xkr4 Gm37381 ... DHRSX CAAA01147332.1
#> rowData names(2): geneID HVG
#> colnames: NULL
#> colData names(10): barcode nCount_RNA ... cell_type subpopulation
#> reducedDimNames(3): PCA UMAP TSNE
#> mainExpName: NULL
#> altExpNames(0):
Do some quick QC to make sure the data loaded correctly and is what we expected.
# Check sce dimensions
dim(sce)
#> [1] 20905 105329
# Sample metadata
head(colData(sce))
#> DataFrame with 6 rows and 10 columns
#> barcode nCount_RNA nFeature_RNA animal batch animal_type
#> <character> <numeric> <integer> <factor> <factor> <factor>
#> 1 AAACCTGGTCAGTGGA 2100.06 815 OO1L Batch1 OO
#> 2 AAACCTGGTGTCAATC 4356.88 3120 OO1L Batch1 OO
#> 3 AAACCTGTCAAACCAC 2679.97 1208 OO1L Batch1 OO
#> 4 AAACCTGTCGTTACAG 3647.74 2137 OO1L Batch1 OO
#> 5 AAACGGGCACGAGAGT 1904.85 703 OO1L Batch1 OO
#> 6 AAAGATGAGCGTAGTG 3732.96 2247 OO1L Batch1 OO
#> percent_mito percent_ribo cell_type subpopulation
#> <numeric> <numeric> <factor> <factor>
#> 1 1.253203 5.81833 OPC qOPC
#> 2 0.510883 3.48925 NendC NendC_3
#> 3 0.789625 3.67955 OPC qOPC
#> 4 0.607773 3.99532 GABA GABA_3
#> 5 1.746996 8.52778 EC EC_1
#> 6 0.652196 3.85105 GABA GABA_13
# Includes cell colors from the original paper
metadata(sce)
#> $cell_colors
#> OPC OLG OEG NSC
#> "olivedrab4" "olivedrab3" "olivedrab1" "royalblue4"
#> ARP ASC EPC HypEPC
#> "steelblue4" "steelblue1" "lightgoldenrod4" "lightgoldenrod3"
#> TNC CPC NRP ImmN
#> "lightgoldenrod2" "gold" "darkmagenta" "purple3"
#> GABA DOPA GLUT CHOL
#> "mediumorchid3" "violetred3" "palevioletred" "violet"
#> NendC EC PC VSMC
#> "lightpink" "sienna4" "sienna3" "sienna1"
#> Hb_VC VLMC ABC MG
#> "peru" "peachpuff4" "peachpuff3" "red4"
#> MAC MNC DC NEUT
#> "red3" "tomato3" "red1" "tomato1"
#> T_cell NK B_cell
#> "salmon3" "indianred2" "coral"
# The count matrix. Transcript for each gene per cell (column)
head(counts(sce))
#> 6 x 105329 sparse Matrix of class "dgCMatrix"
#>
#> Xkr4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
#> Sox17 . . . . . . . . 4 . . . . . . . . . . . . . . . . . . 3 . . . . . .
#> Mrpl15 . 1 . . . . . . 1 . . . . . . . 1 . . . . 1 . . . . . . . . . . . 2
#> Lypla1 . . . . . . . . 1 . . . . . . . . . . 1 . . . . 2 . . . . . . . . .
#>
#> Xkr4 ......
#> Gm37381 ......
#> Rp1 ......
#> Sox17 ......
#> Mrpl15 ......
#> Lypla1 ......
#>
#> .....suppressing 105295 columns in show(); maybe adjust options(max.print=, width=)
#> ..............................
In this step, we can explore and visualize mitochondrial content and read count. However, the authors have already removed low-quality cells and animals so we will skip this section in this vignette. For more details on their workflow, one can refer to the original article Ximerakis & Holton et al. (2023). The OSCA Bioconductor book also provides several examples of quality control steps as well.
For the purposes of demonstration, we’ll subset this SingleCellExperiment
object down to 1000 cells.
sce_subset <- sce[, 1:1000]
set.seed(101000110)
clusters <- quickCluster(sce_subset)
sce_subset <- computeSumFactors(sce_subset, clusters=clusters)
sce_subset <- logNormCounts(sce_subset)
head(logcounts(sce_subset))
#> 6 x 1000 sparse Matrix of class "dgCMatrix"
#>
#> Xkr4 . . . . . . . . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . . . . . . . . .
#> Sox17 . . . . . . . . 1.5643042 . . . . . . . . . . .
#> Mrpl15 . 0.5233882 . . . . . . 0.5746703 . . . . . . . 1.112038 . . .
#> Lypla1 . . . . . . . . 0.5746703 . . . . . . . . . . 0.6720082
#>
#> Xkr4 . . . . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . . . . .
#> Sox17 . . . . . . . 2.5288 . . . . . . . .
#> Mrpl15 . 1.579542 . . . . . . . . . . . 1.123285 . 0.8410208
#> Lypla1 . . . . 1.259965 . . . . . . . . . . 0.8410208
#>
#> Xkr4 . . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . . .
#> Sox17 0.9842773 . . 1.332152 . . . . 2.424116 . . . . .
#> Mrpl15 0.5744997 . . . . . . . . 0.9852856 1.100521 1.193438 . .
#> Lypla1 . . . . . . . . . 0.9852856 . . . .
#>
#> Xkr4 . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . .
#> Sox17 . . . . . . . . . . . . .
#> Mrpl15 . . . . . . . . . 0.7665183 . 0.8860359 0.2713455
#> Lypla1 . 2.121143 1.464452 . . . . 1.215073 . . . . 0.2713455
#>
#> Xkr4 . . . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . . . .
#> Sox17 . . . . . . . . . . . 1.664705 . . .
#> Mrpl15 . . . . 0.7096103 1.174654 . . . . 0.9360896 . 1.213608 . .
#> Lypla1 . . . . . . . . . . . . . . .
#>
#> Xkr4 . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . .
#> Sox17 . . . . . . . . . . . . .
#> Mrpl15 0.7798312 1.554971 . . . . . . . . 1.023144 . .
#> Lypla1 . . 1.145008 . 0.6131276 . . . . . . 1.248215 .
#>
#> Xkr4 . . . . . . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . . . . . . .
#> Sox17 . . . . . . . . . 2.7716398 . . . . . . . .
#> Mrpl15 0.6381288 . 1.179908 . . . 0.9900627 . . . . . . . . . . .
#> Lypla1 . . . . . . . . . 0.6625552 . . . . . . . .
#>
#> Xkr4 . . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . . .
#> Sox17 . . . . . . . . . . . . 0.720007 1.2419781
#> Mrpl15 . 0.901983 . . . . . . . 0.7742218 . 1.077908 0.720007 .
#> Lypla1 1.084206 . . . . . . . . . . . . 0.5410939
#>
#> Xkr4 . . . . . . . . . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . . . . . . . . . .
#> Sox17 0.9334589 . . . . . . . . . . . . . . . . . . . .
#> Mrpl15 0.9334589 . . 1.313662 . . . 1.35898 . . . . . . . . . . . . .
#> Lypla1 0.9334589 . . . . . . . . . . . . . . . . . 2.022082 . .
#>
#> Xkr4 . . . . . . . . . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . . . . . . . . . .
#> Sox17 . . . . . . . . . . . . . . . . . . . . .
#> Mrpl15 0.5796301 . . . . . . . . . . . . . . . . . 1.255032 . .
#> Lypla1 0.5796301 . . . . . . . . . . 1.295959 . . . . 1.839483 . 1.255032 . .
#>
#> Xkr4 . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . .
#> Rp1 . . . . . . . . . . .
#> Sox17 . . 3.344642 . . . . . . . .
#> Mrpl15 . 1.347905 1.206883 . . . . 1.050082 . 0.9939139 0.4586184
#> Lypla1 . . 1.206883 . . . . . 1.807354 . 0.8060768
#>
#> Xkr4 . . . . 1.828623 . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . . . .
#> Sox17 . . . . . . . . . . . . . . .
#> Mrpl15 0.763488 . 1.077016 . . . . . . . 0.9626072 . . . .
#> Lypla1 . . 1.077016 1.066952 . . . . . . . . . 0.88346 .
#>
#> Xkr4 . . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . . .
#> Sox17 . . . . . . . . . . . . . .
#> Mrpl15 . . . . . 1.325547 1.441471 . 1.002133 . . . . .
#> Lypla1 1.361774 . . 1.194158 . . . . . . . . . .
#>
#> Xkr4 . . . . . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . . . . . .
#> Sox17 . . . . . . . . . . . 2.441793 . . . . .
#> Mrpl15 . . . . . . . . . . . . . 1.063681 . . .
#> Lypla1 0.9813761 1.358285 . . . . . . . . . . 0.8207432 . . . .
#>
#> Xkr4 . . . . . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . . . . . .
#> Sox17 . . . . . . . . . . . . . . . . .
#> Mrpl15 . 0.9326992 . 0.7133822 . . . . 0.8350925 1.062774 . . . . . . .
#> Lypla1 . . . 0.7133822 . . . . . . . . . . 1.459828 . .
#>
#> Xkr4 . . . . . . . . . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . . . . . . . . . .
#> Sox17 . . . . . . . . . . . . . . . . . . . . .
#> Mrpl15 . . . . . . . . . . . 1.280672 . . 0.6954811 . . . . 1.009135 .
#> Lypla1 . . . . . . . . . 0.8671596 . 1.280672 . . . . . . . . .
#>
#> Xkr4 . 0.4001547 . . . . . . . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . . . . . . . . . .
#> Sox17 . . . . . . . . . . . 1.6616714 . . . . . . . . .
#> Mrpl15 . . . . . . . . . . . 0.6238267 . . 1.034631 . . . . . 1.215209
#> Lypla1 . . . . . . . . . . . 0.6238267 . . . . . . . . .
#>
#> Xkr4 . . . . . . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . . . . . . .
#> Sox17 . . . . . . . . . . . . . . . . . .
#> Mrpl15 . . . . . 0.8356182 . . . . . . . . . . 0.5851003 .
#> Lypla1 . . . . 1.028199 . . . . . 1.103403 . . . . . . .
#>
#> Xkr4 . . . . . . . . . .
#> Gm37381 . . . . . . . . . .
#> Rp1 . . . . . . . . . .
#> Sox17 . 1.024739 . . . . . . . .
#> Mrpl15 1.180627 . . 0.8871162 1.135023 . . . . .
#> Lypla1 . . 0.7317338 . . . . 1.633901 . 1.104808
#>
#> Xkr4 . . . . . 0.1954573 . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . . . .
#> Sox17 . . . . . . . . . . . . . . .
#> Mrpl15 . . . . . . . . . 2.045557 . . . . 1.478104
#> Lypla1 0.8426096 . . . . . . . 1.063089 . . . . . .
#>
#> Xkr4 . . . . 0.5649848 . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . . . . .
#> Sox17 . . . . . . . . . . . . . . . .
#> Mrpl15 0.5564974 . . . . . . . . . 1.731849 . . . . .
#> Lypla1 0.5564974 . . . . . . . . . . 0.2537375 . 1.346245 . .
#>
#> Xkr4 . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . .
#> Sox17 . . . . . . . . . 0.6752665 . . .
#> Mrpl15 0.6047446 . . . . . . 1.20435 0.7075454 1.1334211 1.080467 . .
#> Lypla1 0.6047446 . 1.787421 . . . . 1.20435 . . . . .
#>
#> Xkr4 . . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . . .
#> Sox17 . . . . . . . . . . . . . 1.392147
#> Mrpl15 1.619455 . . . . . 0.8041854 . . 0.3470071 0.6673938 . . .
#> Lypla1 . . . . . . . . . . 0.6673938 . . .
#>
#> Xkr4 . . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . . .
#> Sox17 . . . . . . . . . . . . . .
#> Mrpl15 0.5270577 0.5124276 . 1.475556 . . . . . . . . 1.575782 1.199081
#> Lypla1 . . . . . . . . . . . . . .
#>
#> Xkr4 . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . .
#> Rp1 . . . . . . . . . . .
#> Sox17 . . . . . . . . . . .
#> Mrpl15 0.8514346 . 1.018749 . 0.9505861 . . . . 1.019252 1.0701977
#> Lypla1 . . . . . . 1.062606 . . 1.019252 0.4505633
#>
#> Xkr4 . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . .
#> Sox17 . . . . . . . . . . . . .
#> Mrpl15 2.030377 . 1.001029 . . . 0.6318676 0.4916192 . . . . .
#> Lypla1 . . . . . . . . . . 0.8406871 . .
#>
#> Xkr4 . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . .
#> Sox17 . . . . . . . . . . . . .
#> Mrpl15 1.058742 . . . 1.922388 . 0.4329131 . 0.778332 . 0.9554603 1.028358 .
#> Lypla1 . . . . . . 0.4329131 . . . . . .
#>
#> Xkr4 . . . . . . . . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . . . . . . . . .
#> Sox17 . . . . . . 1.0919245 . . . . . . . . . . . . .
#> Mrpl15 1.352664 . . . . . . . . . . . . . . . . 1.289281 . 1.630984
#> Lypla1 . . . . . . 0.4617318 . . . . . . . . . . . . .
#>
#> Xkr4 . . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . . .
#> Sox17 1.4597816 . . . . . . . . . . . . .
#> Mrpl15 . 1.146027 . . 1.185001 . . 0.977712 . . . . . .
#> Lypla1 0.9071472 . . . . 1.129527 . . . 0.9263486 . . . .
#>
#> Xkr4 . . . . . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . . . . . .
#> Sox17 . . . . . . . . . . 1.704822 . 1.933082 . . . .
#> Mrpl15 . . . 0.7430015 . . . . . . . . . . 1.238674 . 0.2752936
#> Lypla1 . . . . . . . . . . . . . . . . 0.2752936
#>
#> Xkr4 . . . . . . . . . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . . . . . . . . . .
#> Sox17 . . . . . . . . . . 1.869425 . . . . . . . . . .
#> Mrpl15 . . . . . 1.055032 . . . . . . . 1.306803 . . . . . . 2.810938
#> Lypla1 . . . . . 1.055032 . . . . . . . . . . . . . . .
#>
#> Xkr4 . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . .
#> Sox17 . . . . . . . . . . . . .
#> Mrpl15 0.4185988 . . 1.753894 . 0.9182236 . . . . 1.047351 0.5898912 0.9896414
#> Lypla1 . . . . . . . . . . . . 0.9896414
#>
#> Xkr4 . . . . . . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . . . . . . .
#> Sox17 2.6643793 . . . . . . . . . . . . . . . . .
#> Mrpl15 0.9183284 0.761651 . . . 0.804518 . 0.9375683 . . 1.07072 . . . . . . .
#> Lypla1 . . . . . . . . . . . . . . . . . .
#>
#> Xkr4 . . . . . . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . . . . . . .
#> Sox17 . . . . . . . . . . . . . . . . . .
#> Mrpl15 . 0.9160861 . . . . . . . . . . . . . 1.190141 . .
#> Lypla1 . . . . . 0.9592982 . . . . . . . . . . 2.399757 .
#>
#> Xkr4 . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . .
#> Rp1 . . . . . . . . . . .
#> Sox17 1.015671 . . . 1.347773 . . . . . .
#> Mrpl15 . . . . . 1.946448 . 0.9289516 . 1.223114 .
#> Lypla1 . . . 1.057739 2.032234 . . . . . 1.13841
#>
#> Xkr4 . . . . . . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . . . . . . .
#> Sox17 . . . . . . . . . . . . . . 2.416728 . . .
#> Mrpl15 . . . . 1.712308 . . . 0.9314978 1.135349 . . . . . . . .
#> Lypla1 . . . . . . . 1.922973 . . . . . . . . . .
#>
#> Xkr4 . . . . . . . . . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . . . . . . . . . .
#> Sox17 . . . . . . . . . . . . . . . . . . . . .
#> Mrpl15 . . . . . . . . . . . . 0.421024 . . . . . . . .
#> Lypla1 0.8706139 0.4575438 1.613578 . . . . . . . . . . . . . . . . . .
#>
#> Xkr4 . . . . . . . . . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . . . . . . . . . .
#> Sox17 . . . . . . . . . . . . . . . . 3.517737 . . . .
#> Mrpl15 . . . . . . . . . . . . . . . . . . . . .
#> Lypla1 . 0.8067039 . . . . . . 1.145792 . . . . . . . . . . . .
#>
#> Xkr4 . . . . . . . . . .
#> Gm37381 . . . . . . . . . .
#> Rp1 . . . . . . . . . .
#> Sox17 . . . . . . 0.5069516 1.307279 . .
#> Mrpl15 . 2.200069 . . . . 0.8813425 . 0.4777081 1.652715
#> Lypla1 1.359879 1.484141 1.629933 . . . . . . .
#>
#> Xkr4 . . . . . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . . . . . .
#> Sox17 . . . . . . . . . . . . . . . . .
#> Mrpl15 0.995408 . . 1.051093 . . . 0.9019255 0.9826822 . . . . . . . .
#> Lypla1 . . . 1.051093 . . . . . . . . . . . . 1.730438
#>
#> Xkr4 . . . . . . . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . . . . . . . .
#> Sox17 1.334578 . . . . . . . . . . . . . . . . . .
#> Mrpl15 . 1.029931 . 0.6025174 . . . . . . . . . . 1.021928 . . . .
#> Lypla1 . . . . . . . . . . . . . . . . . . .
#>
#> Xkr4 . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . .
#> Rp1 . . . . . . . . . . .
#> Sox17 . . . . . . . . . . .
#> Mrpl15 . . . . . 1.151037 1.21857 1.013512 . 1.048564 1.13555
#> Lypla1 0.9835904 . 0.6597074 . . . 1.21857 . . . .
#>
#> Xkr4 . . . . . 0.20196 . . . . .
#> Gm37381 . . . . . . . . . . .
#> Rp1 . . . . . . . . . . .
#> Sox17 1.135621 . . . 2.211818 . . . . 1.300527 .
#> Mrpl15 . 2.139551 . 0.9284293 . . . . . . .
#> Lypla1 . . . . . . . . . . .
#>
#> Xkr4 . . . . . . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . . . . . . .
#> Sox17 . . . . . . . . . 2.382525 . . . . . . . .
#> Mrpl15 . . . . . . . 1.09985 . . . . . . . . . .
#> Lypla1 1.388055 . . . . . . . 1.272972 . 0.7142511 . . . . . . .
#>
#> Xkr4 . . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . . .
#> Sox17 . . . . . . . . . . . . . .
#> Mrpl15 . . 0.7736128 1.072347 . . . 2.176932 1.147782 . . . . .
#> Lypla1 . . 0.7736128 . . . 0.7826772 . . . . . . 1.018804
#>
#> Xkr4 . . . . . . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . . . . . . .
#> Sox17 . . . . . . . . 2.986923 . . . . . . . . .
#> Mrpl15 . . . . . 0.9626802 . . . . 1.508434 . . . . . 0.3224568 .
#> Lypla1 . . . . . . . 1.90434 1.107444 . . . . . . . . .
#>
#> Xkr4 . . . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . . . .
#> Sox17 . . . 1.163286 . . . . . . . . . . .
#> Mrpl15 . . . . 0.9329641 . 0.5382496 . . . . . 0.7042636 . .
#> Lypla1 . . . . . . . . . . 0.8334478 . . . .
#>
#> Xkr4 . . . . . . . . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . . . . . . . . .
#> Sox17 . . . . . . . . . . . . . . . . . . . .
#> Mrpl15 0.907859 . . 1.354583 . . . . . . 0.9220908 . . . . . . . 1.465526 .
#> Lypla1 . . . . . . . . . . . . . . . . . . . .
#>
#> Xkr4 . . . . . . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . . . . . . .
#> Sox17 1.1817280 . . . . . . . . . . . . . . 1.180873 . .
#> Mrpl15 . 1.669089 . . . . . . . . . . . . 1.0697 . . .
#> Lypla1 0.7086213 . . . . . . . . . 1.136861 . . . . . . .
#>
#> Xkr4 . . . . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . . . . .
#> Sox17 . . . . . . . . . . . . . . . .
#> Mrpl15 0.9116169 . . . . . . . . 0.6760821 1.041988 . . 0.3222847 1.052896 .
#> Lypla1 . . . . . . . . . . . . . 0.8081190 0.620441 .
#>
#> Xkr4 . . . . . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . . . . . .
#> Sox17 . . . . . . . . . . . . . . . . .
#> Mrpl15 . . . . . . . . . 0.6839039 . 1.94683 . . . . .
#> Lypla1 1.181808 . . . . . . . . 0.6839039 0.8882563 . . . . 0.9024536 .
#>
#> Xkr4 . . . . . . . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . . . . . . . .
#> Sox17 . . . . . 1.824439 . . . . . . . . . 1.4779644 . . .
#> Mrpl15 . . . . . . . . . . . . . . . . . 0.3134483 .
#> Lypla1 . 1.082294 . . . . . . . . . . . . . 0.9205045 . . .
#>
#> Xkr4 . . . . . . . . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . . . . . . . . .
#> Sox17 . . . . . . . . . . . . . . . . . . . .
#> Mrpl15 0.968804 . . . 0.7972665 . . . . . . . . . . . . . . .
#> Lypla1 . . . 1.11526 . . . . . . . . . . . . . . 0.6574669 .
#>
#> Xkr4 . . . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . . . .
#> Sox17 . . . . . . . . . . . . . . .
#> Mrpl15 . . . . 1.575711 . . . . . . 1.345679 . . .
#> Lypla1 1.724263 . 1.225784 1.020774 . . . . . . 1.129583 1.345679 . . .
#>
#> Xkr4 . . . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . . . .
#> Sox17 . . . . . . . . . . . . . . .
#> Mrpl15 0.8851629 1.152087 0.328535 1.714225 . . . 2.150366 . . . . . . .
#> Lypla1 . 1.152087 . . . . . . . . . . . . .
#>
#> Xkr4 . . . . . . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . . . . . . .
#> Sox17 . . . . . . . . . . . . . . . . . .
#> Mrpl15 . . . . . . . . . . . . . . 1.134531 1.078725 . .
#> Lypla1 0.5928731 . . . . 1.075522 . . . . . . . . 1.134531 . . 1.18754
#>
#> Xkr4 . . . . . . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . . . . . . .
#> Sox17 . . . . . . . . . 0.5318574 . . . . . . 1.534475 .
#> Mrpl15 . . . . . . 0.321697 . . . . . . . . 1.375003 . .
#> Lypla1 . . . . . . . . . 0.5318574 . . . . . . . .
#>
#> Xkr4 . . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . . .
#> Sox17 . . . . . . . . . . . . . 1.274659
#> Mrpl15 1.056787 . . . . . . . . 1.429754 1.480849 . . .
#> Lypla1 . 0.2261146 . . . . . . . . . . . .
#>
#> Xkr4 . . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . . .
#> Sox17 . . . . . . . . . . . . . .
#> Mrpl15 . . 0.9961864 . . . . . . 1.155811 . . . 1.092581
#> Lypla1 1.099067 . . 0.9767412 . . . . . . . . . 1.092581
#>
#> Xkr4 . . . . . . . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . . . . . . . .
#> Sox17 . . . . . 2.631682 . . . . . . . . . . . . .
#> Mrpl15 0.6017133 . . . . . 1.130003 . . . . . . . . 0.9746338 . . .
#> Lypla1 . . . . . . . . . . . . . . . . . . .
#>
#> Xkr4 . . . . . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . . . . . .
#> Sox17 . . . . . . . . . . . . . . . . .
#> Mrpl15 0.6990818 . 0.6451031 1.316759 . . 1.28384 . . . . 1.788541 . . . . .
#> Lypla1 0.6990818 . . . . . . . . . . . . . . . .
#>
#> Xkr4 . . . . . . . . . . . . . . . . .
#> Gm37381 . . . . . . . . . . . . . . . . .
#> Rp1 . . . . . . . . . . . . . . . . .
#> Sox17 . . . . . . . . . . . . . . . . .
#> Mrpl15 1.444838 . . . . . . . . . . . . . . 1.722671 .
#> Lypla1 . . . . . . . . . . 2.020137 . . . . . .
At this point a typical workflow, we could select an appropriate set of highly variable genes (HVGs), say the top 10% of genes with the highest variability in expression. Below is an example of how to do this.
dec <- modelGeneVar(sce_subset)
hvg <- getTopHVGs(dec, prop=0.1)
A logical index showing the 2000 HVG included in the original study can also be
accessed in the SingleCellExperiment
object in the rowData()
slot.
Below is a method for running a Principal Components Analysis using our previously defined HVGs.
set.seed(1234)
sce_subset <- runPCA(sce_subset, ncomponents=25, subset_row=hvg)
# Add PCA coords to sce object
However, the authors have also provided us with the first 50 PCs used in their study. For consistent with their study, we will use these.
head(reducedDim(sce_subset, "PCA"))[1:5, 1:5]
#> PC1 PC2 PC3 PC4 PC5
#> [1,] 3.7896377 -2.0354706 -1.3315832 0.3672115 1.0848995
#> [2,] 1.5902497 -5.5788552 -10.3563694 3.4867199 -0.3234046
#> [3,] 3.8162534 -3.3919824 -1.8970444 0.7165197 1.2934682
#> [4,] 1.7208498 -4.2866718 -9.3561901 2.3150841 -0.4629331
#> [5,] -0.7078829 -0.6319163 0.4068132 -18.8230666 2.9753249
colLabels(sce_subset) <- clusterCells(sce_subset, use.dimred='PCA',
BLUSPARAM=NNGraphParam(cluster.fun="louvain"))
For this dataset, the authors have already provided us with their exact UMAP and
TSNE coordinates, as well as their color scheme representing the cell types from
their paper. This can be accessed in the metadata slot of the
SingleCellExperiment
object with the metadata()
function.
# Generate color map matching cell type to colors in publication
cell.color <- metadata(sce_subset)$cell_color
gg <- plotUMAP(sce_subset, color_by = "cell_type", text_by = "cell_type")
gg + theme(legend.title=element_blank()) +
scale_color_manual(values=c(cell.color))
#> Scale for colour is already present.
#> Adding another scale for colour, which will replace the existing scale.
#> Warning: Removed 4 rows containing missing values (`geom_text_repel()`).
This plot is a recreation of Fig. 2C from Ximerakis & Holton et al. 2023.
We can also plot a TSNE with their provided coordinates.
gg <- plotTSNE(sce, color_by = "cell_type", text_by = "cell_type")
gg + theme(legend.title=element_blank()) +
scale_color_manual(values=c(cell.color))
#> Scale for colour is already present.
#> Adding another scale for colour, which will replace the existing scale.
If you would like to create your own UMAP and TSNE plots, please refer back to
the OSCA Bioconductor book
and save our own coordinates to the SingleCellExperiment
object. Below is some
example code to achieve this.
Start with a UMAP.
# Add our UMAP to the reducedDims slot with the name "osca_UMAP" so we do not
# confused it with the author's UMAP coords.
sce <- runUMAP(sce, dimred = 'PCA', name = "osca_UMAP")
# When we want to access a specific item (here, "osca_UMAP") in the reducedDims
# element of the SingleCellExperiment object, we can use the function
# plotReducedDim with the argument dimred.
gg <- plotReducedDim(sce, dimred = "osca_UMAP", color_by = "cell_type",
text_by = "cell_type")
gg + theme(legend.title=element_blank()) +
scale_color_manual(values=c(cell.color))
#> Scale for colour is already present.
#> Adding another scale for colour, which will replace the existing scale.
#> Warning: ggrepel: 1 unlabeled data points (too many overlaps). Consider
#> increasing max.overlaps
Now with a TSNE.
# Run TSNE
set.seed(00101001101)
# runTSNE() stores the t-SNE coordinates in the reducedDims
sce <- runTSNE(sce, dimred = 'PCA', name = "osca_TSNE")
gg <- scater::plotReducedDim(sce, dimred = "osca_TSNE", color_by = "cell_type",
text_by = "cell_type")
gg + theme(legend.title=element_blank()) +
scale_color_manual(values=c(cell.color))
#> Scale for colour is already present.
#> Adding another scale for colour, which will replace the existing scale.
Ximerakis & Holton et al. (2023) Heterochronic parabiosis reprograms the mouse brain transcriptome by shifting aging signatures in multiple cell types. 3, 327–345. DOI:https://doi.org/10.1038/s43587-023-00373-6.
sessionInfo()
#> R Under development (unstable) (2024-01-16 r85808)
#> Platform: x86_64-pc-linux-gnu
#> Running under: Ubuntu 22.04.3 LTS
#>
#> Matrix products: default
#> BLAS: /home/biocbuild/bbs-3.19-bioc/R/lib/libRblas.so
#> LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.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] MouseAgingData_0.99.1 ExperimentHub_2.11.1
#> [3] AnnotationHub_3.11.1 BiocFileCache_2.11.1
#> [5] dbplyr_2.4.0 bluster_1.13.0
#> [7] scater_1.31.2 ggplot2_3.4.4
#> [9] scran_1.31.2 scuttle_1.13.0
#> [11] SingleCellExperiment_1.25.0 SummarizedExperiment_1.33.3
#> [13] Biobase_2.63.0 GenomicRanges_1.55.2
#> [15] GenomeInfoDb_1.39.6 IRanges_2.37.1
#> [17] S4Vectors_0.41.3 BiocGenerics_0.49.1
#> [19] MatrixGenerics_1.15.0 matrixStats_1.2.0
#> [21] BiocStyle_2.31.0
#>
#> loaded via a namespace (and not attached):
#> [1] DBI_1.2.1 bitops_1.0-7
#> [3] gridExtra_2.3 rlang_1.1.3
#> [5] magrittr_2.0.3 RcppAnnoy_0.0.22
#> [7] compiler_4.4.0 RSQLite_2.3.5
#> [9] DelayedMatrixStats_1.25.1 png_0.1-8
#> [11] vctrs_0.6.5 pkgconfig_2.0.3
#> [13] crayon_1.5.2 fastmap_1.1.1
#> [15] XVector_0.43.1 labeling_0.4.3
#> [17] utf8_1.2.4 rmarkdown_2.25
#> [19] ggbeeswarm_0.7.2 purrr_1.0.2
#> [21] bit_4.0.5 xfun_0.42
#> [23] zlibbioc_1.49.0 cachem_1.0.8
#> [25] beachmat_2.19.1 jsonlite_1.8.8
#> [27] blob_1.2.4 highr_0.10
#> [29] DelayedArray_0.29.1 BiocParallel_1.37.0
#> [31] irlba_2.3.5.1 parallel_4.4.0
#> [33] cluster_2.1.6 R6_2.5.1
#> [35] bslib_0.6.1 limma_3.59.2
#> [37] jquerylib_0.1.4 Rcpp_1.0.12
#> [39] bookdown_0.37 knitr_1.45
#> [41] Matrix_1.6-5 igraph_2.0.1.1
#> [43] tidyselect_1.2.0 abind_1.4-5
#> [45] yaml_2.3.8 viridis_0.6.5
#> [47] codetools_0.2-19 curl_5.2.0
#> [49] lattice_0.22-5 tibble_3.2.1
#> [51] KEGGREST_1.43.0 withr_3.0.0
#> [53] Rtsne_0.17 evaluate_0.23
#> [55] Biostrings_2.71.2 filelock_1.0.3
#> [57] pillar_1.9.0 BiocManager_1.30.22
#> [59] generics_0.1.3 RCurl_1.98-1.14
#> [61] BiocVersion_3.19.1 sparseMatrixStats_1.15.0
#> [63] munsell_0.5.0 scales_1.3.0
#> [65] glue_1.7.0 metapod_1.11.1
#> [67] tools_4.4.0 BiocNeighbors_1.21.2
#> [69] ScaledMatrix_1.11.0 locfit_1.5-9.8
#> [71] cowplot_1.1.3 grid_4.4.0
#> [73] AnnotationDbi_1.65.2 edgeR_4.1.16
#> [75] colorspace_2.1-0 GenomeInfoDbData_1.2.11
#> [77] beeswarm_0.4.0 BiocSingular_1.19.0
#> [79] vipor_0.4.7 cli_3.6.2
#> [81] rsvd_1.0.5 rappdirs_0.3.3
#> [83] fansi_1.0.6 S4Arrays_1.3.3
#> [85] viridisLite_0.4.2 dplyr_1.1.4
#> [87] uwot_0.1.16 gtable_0.3.4
#> [89] sass_0.4.8 digest_0.6.34
#> [91] SparseArray_1.3.4 ggrepel_0.9.5
#> [93] dqrng_0.3.2 farver_2.1.1
#> [95] memoise_2.0.1 htmltools_0.5.7
#> [97] lifecycle_1.0.4 httr_1.4.7
#> [99] mime_0.12 statmod_1.5.0
#> [101] bit64_4.0.5