10.3 Labeling scATAC-seq clusters with scRNA-seq information
Now that we are confident in the alignment of our scATAC-seq and scRNA-seq, we can label our scATAC-seq clusters with the cell types from our scRNA-seq data.
First, we will create a confusion matrix between our scATAC-seq clusters and the predictedGroup
obtained from our integration analysis.
<- confusionMatrix(projHeme3$Clusters, projHeme3$predictedGroup)
cM <- rownames(cM)
labelOld
labelOld## [1] "C9" "C6" "C10" "C4" "C1" "C3" "C7" "C5" "C8" "C11" "C12" "C2"
Then, for each of our scATAC-seq clusters, we identify the cell type from predictedGroup
which best defines that cluster.
<- colnames(cM)[apply(cM, 1, which.max)]
labelNew
labelNew## [1] "17_B" "25_NK" "16_Pre.B" "08_GMP.Neut"
## [5] "11_CD14.Mono.1" "02_Early.Eryth" "20_CD4.N1" "01_HSC"
## [9] "22_CD4.M" "09_pDC" "15_CLP.2" "12_CD14.Mono.2"
Next we need to reclassify these new cluster labels to make a simpler categorization system. For each scRNA-seq cluster, we will re-define its label to something easier to interpret.
<- c(
remapClust "01_HSC" = "Progenitor",
"02_Early.Eryth" = "Erythroid",
"03_Late.Eryth" = "Erythroid",
"04_Early.Baso" = "Basophil",
"05_CMP.LMPP" = "Progenitor",
"06_CLP.1" = "CLP",
"07_GMP" = "GMP",
"08_GMP.Neut" = "GMP",
"09_pDC" = "pDC",
"10_cDC" = "cDC",
"11_CD14.Mono.1" = "Mono",
"12_CD14.Mono.2" = "Mono",
"13_CD16.Mono" = "Mono",
"15_CLP.2" = "CLP",
"16_Pre.B" = "PreB",
"17_B" = "B",
"18_Plasma" = "Plasma",
"19_CD8.N" = "CD8.N",
"20_CD4.N1" = "CD4.N",
"21_CD4.N2" = "CD4.N",
"22_CD4.M" = "CD4.M",
"23_CD8.EM" = "CD8.EM",
"24_CD8.CM" = "CD8.CM",
"25_NK" = "NK"
)<- remapClust[names(remapClust) %in% labelNew] remapClust
Then, using the mapLabels()
function, we will convert our labels to this new simpler system.
<- mapLabels(labelNew, oldLabels = names(remapClust), newLabels = remapClust)
labelNew2
labelNew2## [1] "B" "NK" "PreB" "GMP" "Mono"
## [6] "Erythroid" "CD4.N" "Progenitor" "CD4.M" "pDC"
## [11] "CLP" "Mono"
Combining labelsOld
and labelsNew2
, we now can use the mapLabels()
function again to create new cluster labels in cellColData
.
$Clusters2 <- mapLabels(projHeme3$Clusters, newLabels = labelNew2, oldLabels = labelOld) projHeme3
With these new labels in hand, we can plot a UMAP with the new cluster identities overlayed.
<- plotEmbedding(projHeme3, colorBy = "cellColData", name = "Clusters2")
p1 ## ArchR logging to : ArchRLogs/ArchR-plotEmbedding-371b031f131d8-Date-2022-12-23_Time-06-57-16.log
## If there is an issue, please report to github with logFile!
## Getting UMAP Embedding
## ColorBy = cellColData
## Plotting Embedding
## 1
## ArchR logging successful to : ArchRLogs/ArchR-plotEmbedding-371b031f131d8-Date-2022-12-23_Time-06-57-16.log
p1
This paradigm can be extremely helpful when analyzing scATAC-seq data from a cellular system where scRNA-seq data already exists. As mentioned previously, this integration of scATAC-seq with scRNA-seq also provides a beautiful framework for more complex gene regulation analyses that will be described in later chapters.
To save an editable vectorized version of this plot, we use the plotPDF()
function.
plotPDF(p1, name = "Plot-UMAP-Remap-Clusters.pdf", ArchRProj = projHeme2, addDOC = FALSE, width = 5, height = 5)
## Plotting Ggplot!
We can now save our original projHeme3 using saveArchRProject
from ArchR. Here, we set load = TRUE
to make sure that the projHeme3
object tracks with the project that we just saved.
<- saveArchRProject(ArchRProj = projHeme3, outputDirectory = "Save-ProjHeme3", load = TRUE)
projHeme3 ## Copying ArchRProject to new outputDirectory : /corces/home/rcorces/scripts/github/ArchR_Website_Testing/bookdown/Save-ProjHeme3
## Copying Arrow Files...
## Copying Arrow Files (1 of 3)
## Copying Arrow Files (2 of 3)
## Copying Arrow Files (3 of 3)
## Getting ImputeWeights
## Dropping ImputeWeights...
## Copying Other Files...
## Copying Other Files (1 of 5): Embeddings
## Copying Other Files (2 of 5): IterativeLSI
## Copying Other Files (3 of 5): IterativeLSI2
## Copying Other Files (4 of 5): Plots
## Copying Other Files (5 of 5): RNAIntegration
## Saving ArchRProject...
## Loading ArchRProject...
## Successfully loaded ArchRProject!
##
## / |
## / \
## . / |.
## \\\ / |.
## \\\ / `|.
## \\\ / |.
## \ / |\
## \\#####\ / ||
## ==###########> / ||
## \\##==......\ / ||
## ______ = =|__ /__ || \\\
## ,--' ,----`-,__ ___/' --,-`-===================##========>
## \ ' ##_______ _____ ,--,__,=##,__ ///
## , __== ___,-,__,--'#' ===' `-' | ##,-/
## -,____,---' \\####\\________________,--\\_##,/
## ___ .______ ______ __ __ .______
## / \ | _ \ / || | | | | _ \
## / ^ \ | |_) | | ,----'| |__| | | |_) |
## / /_\ \ | / | | | __ | | /
## / _____ \ | |\ \\___ | `----.| | | | | |\ \\___.
## /__/ \__\ | _| `._____| \______||__| |__| | _| `._____|
##