batch correction - GSM3872442 set
GSM3872442 is a single PBMMC sample sequenced as a pool of two libraries: SRR9264351 and SRR9264352.
We will use this sample to illustrate batch correction.
qcPlotDirBit <- "NormPlots"
setName <- "GSM3872442"
projDir <- "/mnt/scratcha/bioinformatics/baller01/20200511_FernandesM_ME_crukBiSs2020"
outDirBit <- "AnaWiSce/Attempt1"
 Prepare data
Load object
setSuf <- ""
# Read object in:
tmpFn <- sprintf("%s/%s/Robjects/%s_sce_nz_postQc%s.Rds", projDir, outDirBit, "caron", setSuf)
sce <- readRDS(tmpFn)
Select the GSM3872442 cells:
sample1.nz.sce <- SingleCellExperiment(list(counts=counts(sce[, sce$Run %in% c("SRR9264351")])),
colData=colData(sce[, sce$Run %in% c("SRR9264351")]))
sample2.nz.sce <- SingleCellExperiment(list(counts=counts(sce[, sce$Run %in% c("SRR9264352")])),
colData=colData(sce[, sce$Run %in% c("SRR9264352")]))
 Normalise each separately and re-pool
sample1.clusters <- quickCluster(sample1.nz.sce, method="igraph")
sample1.nz.sce <- computeSumFactors(sample1.nz.sce, min.mean=0.1, cluster=sample1.clusters)
sample1.nz.sce <- logNormCounts(sample1.nz.sce)
sample2.clusters <- quickCluster(sample2.nz.sce, method="igraph")
sample2.nz.sce <- computeSumFactors(sample2.nz.sce, min.mean=0.1, cluster=sample2.clusters)
sample2.nz.sce <- logNormCounts(sample2.nz.sce)
Re-pool:
# recombine the normalized samples together
all.samp.exprs <- do.call(cbind,
list("SRR9264351"=exprs(sample1.nz.sce),
"SRR9264352"=exprs(sample2.nz.sce)))
colnames(all.samp.exprs) <- c(as.character(colData(sample1.nz.sce)$Barcode),
as.character(colData(sample2.nz.sce)$Barcode))
For the PCA we want to quickly select the genes that are most informative. We will use the top 2000 genes with the highest variance.
gene.variances <- apply(all.samp.exprs, 1, var)
names(gene.variances) <- rownames(all.samp.exprs)
highly.variable.genes <- names(gene.variances[order(gene.variances, decreasing=TRUE)])[1:2000]
Perform PCA:
# we need to use a fast approximate algorithm for PCA on large data sets
# this algorithm has a stochastic component, so we need to fix the seed number to get the same result each time
set.seed(42)
separate.hvg.pca <- irlba::prcomp_irlba(t(all.samp.exprs[highly.variable.genes, ]), n=5) # we only need a few components
separate.hvg.pcs <- as.data.frame(separate.hvg.pca$x) # extract the principal components
separate.hvg.pcs$Cell <- colnames(all.samp.exprs) # set the sample column as the cell IDs
# combine the PCs with the sample information into a single data frame for plotting
samples.info <- data.frame("Cell"=colnames(all.samp.exprs),
"Run"=c(rep("SRR9264351", ncol(sample1.nz.sce)),
rep("SRR9264352", ncol(sample2.nz.sce))))
# merge the two data frames together
separate.pca.merge <- merge(separate.hvg.pcs, samples.info, by='Cell')
Plot PC1-PC2 plane, with cells colored by ‘Run’ (and sized according to library size):
sce.sep <- cbind(sample1.nz.sce, sample2.nz.sce)
sce.sep <- runPCA(sce.sep)
plotPCA(sce.sep, colour_by="Run", size_by = "sum")
sce.sep <- runTSNE(sce.sep, dimred="PCA")
plotTSNE(sce.sep, colour_by="Run", size_by = "sum")
sce.sep <- runUMAP(sce.sep, dimred="PCA")
plotUMAP(sce.sep, colour_by="Run", size_by = "sum")
Normalise batches together
sample3.nz.sce <- SingleCellExperiment(list(counts=counts(sce[, sce$Run %in% c("SRR9264351", "SRR9264352")])),
colData=colData(sce[, sce$Run %in% c("SRR9264351", "SRR9264352")]))
sample3.clusters <- quickCluster(sample3.nz.sce, method="igraph")
sample3.nz.sce <- computeSumFactors(sample3.nz.sce, min.mean=0.1, cluster=sample3.clusters)
sample3.nz.sce <- logNormCounts(sample3.nz.sce)
pool.exprs <- exprs(sample3.nz.sce)
colnames(pool.exprs) <- gsub(colData(sample3.nz.sce)$Barcode, pattern="-", replacement=".")
Find the 2000 genes with the highest variance:
gene.variances <- apply(pool.exprs, 1, var)
names(gene.variances) <- rownames(pool.exprs)
highly.variable.genes <- names(gene.variances[order(gene.variances, decreasing=TRUE)])[1:2000]
Perform PCA:
# we need to use a fast approximate algorithm for PCA on large data sets
# this algorithm has a stochastic component, so we need to fix the seed number to get the same result each time
set.seed(42)
combined.hvg.pca <- irlba::prcomp_irlba(t(pool.exprs[highly.variable.genes, ]), n=5) # we only need a few components
combined.hvg.pcs <- as.data.frame(combined.hvg.pca$x) # extract the principal components
combined.hvg.pcs$Cell <- colnames(pool.exprs) # set the sample column as the cell IDs
# combine the PCs with the sample information into a single data frame for plotting
samples.info <- data.frame("Cell"=colnames(pool.exprs),
"Run"=colData(sample3.nz.sce)$Run)
# merge the two data frames together
combined.pca.merge <- merge(combined.hvg.pcs, samples.info, by='Cell')
Plot PC1-PC2 plane, with cells colored by ‘Run’ (and sized according to library size):
sample3.nz.sce <- runPCA(sample3.nz.sce)
plotPCA(sample3.nz.sce, colour_by="Run", size_by = "sum")
sample3.nz.sce <- runTSNE(sample3.nz.sce, dimred="PCA")
plotTSNE(sample3.nz.sce, colour_by="Run", size_by = "sum")
sample3.nz.sce <- runUMAP(sample3.nz.sce, dimred="PCA")
plotUMAP(sample3.nz.sce, colour_by="Run", size_by = "sum")
Batch correction
sample3.nz.sce$Run <- factor(sample3.nz.sce$Run)
sample3.nz.sce$batch <- sample3.nz.sce$Run
sce <- sample3.nz.sce
Gaussian (normal) linear models
Limma
suppressMessages(require(limma))
lm_design_batch <- model.matrix(~0 + batch, data = colData(sce))
fit_lm_batch <- lmFit(logcounts(sce), lm_design_batch)
resids_lm_batch <- residuals(fit_lm_batch, logcounts(sce))
assay(sce, "lm_batch") <- resids_lm_batch
reducedDim(sce, "PCA_lm_batch") <- reducedDim(
runPCA(sce, exprs_values = "lm_batch"), "PCA")
plotReducedDim(sce, dimred = "PCA_lm_batch",
colour_by = "batch",
size_by = "sum",
shape_by = "Sample.Name"
) +
ggtitle("LM - regress out batch")
scePreSct <- sce
SCTransform
Batch only
First make a copy of the SCE object (we will need one later).
#Â have log lib size
sce$log10sum <- log10(sce$sum)
sceOrig <- sce
counts <- counts(sce)
colnames(counts) <- colData(sce)$Barcode
### Genes expressed in at least 5 cells will be kept
sctnorm_data <- sctransform::vst(umi = counts, min_cells = 5,
cell_attr = as.data.frame(colData(sce))[,c("log10sum", "batch")],
latent_var = c("batch"),
return_gene_attr = TRUE,
return_cell_attr = TRUE,
show_progress = FALSE)
Warning in sqrt(1/i): NaNs produced
Check model used:
# model:
print(sctnorm_data$model_str)
[1] "y ~ batch"
Check new values (here 3 rows and 3 columns only):
sctnorm_data$y[1:3,1:3]
AAACCTGCACTTCGAA-9 AAACCTGCAGACGCAA-9 AAACCTGTCATCACCC-9
ENSG00000237491 -0.1869210 -0.1869210 -0.1869210
ENSG00000225880 -0.1085787 -0.1085787 -0.1085787
ENSG00000230368 -0.2034637 -0.2034637 -0.2034637
Check object:
sce
class: SingleCellExperiment
dim: 18372 2059
metadata(0):
assays(3): counts logcounts lm_batch
rownames(18372): ENSG00000238009 ENSG00000237491 ... ENSG00000275063
ENSG00000271254
rowData names(0):
colnames: NULL
colData names(22): Sample Barcode ... batch log10sum
reducedDimNames(4): PCA TSNE UMAP PCA_lm_batch
altExpNames(0):
Some genes were not included in the transformation and excluded from the output, so we will remove them from the SCE object too.
# exclude genes that were not used in the transformation:
tmpInd <- which(rownames(sce) %in% rownames(sctnorm_data$y))
cols.meta <- colData(sceOrig)
rows.meta <- rowData(sceOrig)
new.counts <- counts(sceOrig)[tmpInd, ]
sce <- SingleCellExperiment(list(counts=new.counts))
# reset the column data on the new object
colData(sce) <- cols.meta
rowData(sce) <- rows.meta[tmpInd, ]
We now copy the transformation output to the SCE object:
vstMat <- as(sctnorm_data$y[rownames(sce),], "dgCMatrix")
all(colnames(vstMat) == sce$Barcode)
[1] TRUE
dim(vstMat)
[1] 13848 2059
colnames(vstMat) <- NULL
assay(sce, "sctrans_norm_batchOnly") <- vstMat # as(vst_out$y[rownames(sce),], "dgCMatrix")
Also copy ‘logcounts’:
assayX <- "logcounts"
tmpAssay <- assay(sceOrig, assayX)
assay(sce, assayX) <- tmpAssay[tmpInd, ]
Diagnostic plots are shown below:
sctransform::plot_model_pars(sctnorm_data)
The reduced dimension plots below show improved mixing of cells from the two sets:
reducedDim(sce, "PCA_sctrans_norm_batchOnly") <- reducedDim(
runPCA(sce, exprs_values = "sctrans_norm_batchOnly"), "PCA"
)
plotReducedDim(
sce,
dimred = "PCA_sctrans_norm_batchOnly",
colour_by = "batch",
size_by = "sum",
shape_by = "Sample.Name"
) + ggtitle("PCA plot: sctransform normalization - batch only")
sce <- runTSNE(sce, dimred="PCA_sctrans_norm_batchOnly", name="TSNE_sctrans_norm_batchOnly")
plotReducedDim(
sce,
dimred = "TSNE_sctrans_norm_batchOnly",
colour_by = "batch",
size_by = "sum",
shape_by = "Sample.Name"
) + ggtitle("TSNE plot: sctransform normalization - batch only")
sce <- runUMAP(sce, dimred="PCA_sctrans_norm_batchOnly", name="UMAP_sctrans_norm_batchOnly")
plotReducedDim(
sce,
dimred = "UMAP_sctrans_norm_batchOnly",
colour_by = "batch",
size_by = "sum",
shape_by = "Sample.Name"
) + ggtitle("UMAP plot: sctransform normalization - batch only")
Keep copy of SCE object for later:
sce_batchOnly <- sce
Both library size and batch
Use the copy of the SCE object made earlier.
sce <- sceOrig
Some cells are very different from the rest.
### Genes expressed in at least 5 cells will be kept
counts <- counts(sce)
class(counts)
[1] "dgCMatrix"
attr(,"package")
[1] "Matrix"
dgCMatrix
colnames(counts) <- colData(sce)$Barcode
sctnorm_data <- sctransform::vst(umi = counts, min_cells = 5,
cell_attr = as.data.frame(colData(sce))[,c("log10sum", "batch")],
latent_var = c("log10sum", "batch"),
return_gene_attr = TRUE,
return_cell_attr = TRUE,
show_progress = FALSE)
Check model used:
print(sctnorm_data$model_str)
[1] "y ~ log10sum + batch"
Discard genes that were not used in the transformation.
# exclude genes that were not used in the transformation:
tmpInd <- which(rownames(sce) %in% rownames(sctnorm_data$y))
cols.meta <- colData(sceOrig)
rows.meta <- rowData(sceOrig)
new.counts <- counts(sceOrig)[tmpInd, ]
sce <- SingleCellExperiment(list(counts=new.counts))
# reset the column data on the new object
colData(sce) <- cols.meta
rowData(sce) <- rows.meta[tmpInd, ]
Copy the transformation output to the SCE object.
vstMat <- as(sctnorm_data$y[rownames(sce),], "dgCMatrix")
all(colnames(vstMat) == sce$Barcode)
[1] TRUE
colnames(vstMat) <- NULL
assay(sce, "sctrans_norm") <- vstMat
Show diagnostic plots:
sctransform::plot_model_pars(sctnorm_data)
Show reduced dimension plots and check for improved mixing of cells from the two sets:
reducedDim(sce, "PCA_sctrans_norm") <- reducedDim(
runPCA(sce, exprs_values = "sctrans_norm")
)
plotReducedDim(
sce,
dimred = "PCA_sctrans_norm",
colour_by = "batch",
size_by = "sum",
shape_by = "Sample.Name"
) + ggtitle("PCA plot: sctransform normalization")
sce <- runTSNE(sce, dimred="PCA_sctrans_norm", name="TSNE_sctrans_norm")
plotReducedDim(
sce,
dimred = "TSNE_sctrans_norm",
colour_by = "batch",
size_by = "sum",
shape_by = "Sample.Name"
) + ggtitle("TSNE plot: sctransform normalization")
sce <- runUMAP(sce, dimred="PCA_sctrans_norm", name="UMAP_sctrans_norm")
plotReducedDim(
sce,
dimred = "UMAP_sctrans_norm",
colour_by = "batch",
size_by = "sum",
shape_by = "Sample.Name"
) + ggtitle("UMAP plot: sctransform normalization")
Add PCA_sctrans_norm_batchOnly (same cells, only genes may differ)
reducedDim(sce, "PCA_sctrans_norm_batchOnly") <- reducedDim(sce_batchOnly, "PCA_sctrans_norm_batchOnly")
reducedDim(sce, "TSNE_sctrans_norm_batchOnly") <- reducedDim(sce_batchOnly, "TSNE_sctrans_norm_batchOnly")
reducedDim(sce, "UMAP_sctrans_norm_batchOnly") <- reducedDim(sce_batchOnly, "UMAP_sctrans_norm_batchOnly")
scePostSct <- sce
mnnCorrect
 Check presence of batch effect
Same as above but with batchelor commands to make the two batches and identify highly variable genes for faster dimensionality reduction.
sce <- sample3.nz.sce
library(batchelor)
#Â Mind assayNames()
sce1 <- sce[, sce$Run == "SRR9264351"]
sce2 <- sce[, sce$Run == "SRR9264352"]
library(scran)
dec1 <- modelGeneVar(sce1)
dec2 <- modelGeneVar(sce2)
combined.dec <- combineVar(dec1, dec2)
chosen.hvgs <- combined.dec$bio > 0
summary(chosen.hvgs)
Mode FALSE TRUE
logical 8942 9430
As a diagnostic, we check that there actually is a batch effect across these datasets by checking that they cluster separately. Here, we combine the two SingleCellExperiment objects without any correction using the NoCorrectParam() flag, and we informally verify that cells from different batches are separated using a t-SNE plot.
There is a moderate batch effect.
library(scater)
combined <- correctExperiments(A=sce1, B=sce2, PARAM=NoCorrectParam())
Warning in correctExperiments(A = sce1, B = sce2, PARAM = NoCorrectParam()):
ignoring 'colData' fields overlapping 'batchCorrect' output
combined <- runPCA(combined, subset_row=chosen.hvgs)
combined <- runTSNE(combined, dimred="PCA")
combined <- runUMAP(combined, dimred="PCA")
plotPCA(combined, colour_by="batch")
plotTSNE(combined, colour_by="batch")
plotUMAP(combined, colour_by="batch")
reducedDim(sce, "PCA_noCor") <- reducedDim(combined, "PCA")
reducedDim(sce, "TSNE_noCor") <- reducedDim(combined, "TSNE")
reducedDim(sce, "UMAP_noCor") <- reducedDim(combined, "UMAP")
Correct batch effect with mnnCorrect
This is the initial method. It uses gene expression values to identify cells with similar expression patterns in both batches.
Let us get the normalised counts:
batch1 <- logcounts(sce1)
batch2 <- logcounts(sce2)
y <- batchelor::mnnCorrect(
batch1, batch2,
#subset.row = fewer.hvgs,
correct.all = TRUE,
k = 20,
sigma = 0.1,
cos.norm.in = TRUE,
svd.dim = 2
)
Copy the corrected values to the SCE object:
assay(sce, "mnn") <- assay(y, "corrected")
Show reduced dimension plots and check for improved mixing of cells from the two sets:
sce <- runPCA(sce, exprs_values = "mnn")
plotPCA(sce, colour_by="batch")
reducedDim(sce, "PCA_mnn") <- reducedDim(sce, "PCA")
sce <- runTSNE(sce, dimred="PCA_mnn")
plotTSNE(sce, colour_by="batch")
reducedDim(sce, "TSNE_mnn") <- reducedDim(sce, "TSNE")
sce <- runUMAP(sce, dimred="PCA_mnn")
plotUMAP(sce, colour_by="batch")
reducedDim(sce, "UMAP_mnn") <- reducedDim(sce, "UMAP")
fastMNN
This method is faster than mnnCorrect as it identifies nearest neighbours after dimensionality reduction.
fx <- batchelor::fastMNN(
sce,
#correct.all = TRUE,
batch = sce$Run
)
class(fx)
[1] "SingleCellExperiment"
attr(,"package")
[1] "SingleCellExperiment"
SingleCellExperiment
Copy the corrected values to the SCE object:
# fastMNN may drop some genes
# so we may not be able to keep the outcome in 'assay'
assay(sce, "fastmnn") <- assay(fx, "reconstructed")
Show reduced dimension plots and check for improved mixing of cells from the two sets:
fastmnn_pca <- runPCA(assay(sce, "fastmnn"), rank=2) #Â slow
reducedDim(sce, "PCA_fastmnn") <- fastmnn_pca$rotation
plotReducedDim(
sce,
dimred = "PCA_fastmnn",
colour_by = "batch",
size_by = "sum",
shape_by = "Sample.Name"
) + ggtitle("PCA plot: fastMNN")
sce <- runTSNE(sce, dimred="PCA_fastmnn")
plotTSNE(sce, colour_by="batch")
reducedDim(sce, "TSNE_fastmnn") <- reducedDim(sce, "TSNE")
sce <- runUMAP(sce, dimred="PCA_fastmnn")
plotUMAP(sce, colour_by="batch")
reducedDim(sce, "UMAP_fastmnn") <- reducedDim(sce, "UMAP")
Harmony
Harmony [Korsunsky2018fast] is a newer batch correction method, which is designed to operate on PC space. The algorithm proceeds to iteratively cluster the cells, with the objective function formulated to promote cells from multiple datasets within each cluster. Once a clustering is obtained, the positions of the centroids of each dataset are obtained on a per-cluster basis and the coordinates are corrected. This procedure is iterated until convergence. Harmony comes with a theta parameter that controls the degree of batch correction (higher values lead to more dataset integration), and can account for multiple experimental and biological factors on input (see variant of the ‘Hemberg course’).
library(harmony)
Loading required package: Rcpp
reducedDim(sce, "PCA_logcounts") <- reducedDim(
runPCA(sce, exprs_values = "logcounts")
)
#Seeing how the end result of Harmony is an altered dimensional reduction space created on the basis of PCA, we plot the obtained manifold here and exclude it from the rest of the follow-ups in the section.
pca <- as.matrix(reducedDim(sce, "PCA_logcounts"))
harmony_emb <- HarmonyMatrix(pca, sce$batch, theta=2, do_pca=FALSE)
Harmony 1/10
Harmony 2/10
Harmony 3/10
Harmony 4/10
Harmony 5/10
Harmony 6/10
Harmony 7/10
Harmony converged after 7 iterations
reducedDim(sce, "harmony") <- harmony_emb
plotReducedDim(
sce,
dimred = 'harmony',
colour_by = "batch",
size_by = "sum",
shape_by = "Sample.Name"
)
LS0tCnRpdGxlOiAiQ1JVSyBDSSBTdW1tZXIgU2Nob29sIDIwMjAgLSBpbnRyb2R1Y3Rpb24gdG8gc2luZ2xlLWNlbGwgUk5BLXNlcSBhbmFseXNpcyIKc3VidGl0bGU6ICdiYXRjaCBjb3JyZWN0aW9uIC0gNTAwIGNlbGxzIHBlciBzYW1wbGUnCgphdXRob3I6ICJTdGVwaGFuZSBCYWxsZXJlYXUsIFpleW5lcCBLYWxlbmRlciBBdGFrLCBLYXRhcnp5bmEgS2FuaWEiCm91dHB1dDoKICBodG1sX25vdGVib29rOgogICAgY29kZV9mb2xkaW5nOiBoaWRlCiAgICB0b2M6IHllcwogICAgdG9jX2Zsb2F0OiB5ZXMKICAgIG51bWJlcl9zZWN0aW9uczogdHJ1ZQogIGh0bWxfZG9jdW1lbnQ6CiAgICBkZl9wcmludDogcGFnZWQKICAgIHRvYzogeWVzCiAgICBudW1iZXJfc2VjdGlvbnM6IHRydWUKICAgIGNvZGVfZm9sZGluZzogaGlkZQogIGh0bWxfYm9vazoKICAgIGNvZGVfZm9sZGluZzogaGlkZQpwYXJhbXM6CiAgb3V0RGlyQml0OiAiQW5hV2lTY2UvQXR0ZW1wdDEiCi0tLQoKIyBiYXRjaCBjb3JyZWN0aW9uIC0gR1NNMzg3MjQ0MiBzZXQKCkdTTTM4NzI0NDIgaXMgYSBzaW5nbGUgUEJNTUMgc2FtcGxlIHNlcXVlbmNlZCBhcyBhIHBvb2wgb2YgdHdvIGxpYnJhcmllczogU1JSOTI2NDM1MSBhbmQgU1JSOTI2NDM1Mi4KCldlIHdpbGwgdXNlIHRoaXMgc2FtcGxlIHRvIGlsbHVzdHJhdGUgYmF0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