Hello everyone
I am working on four samples from 10X spatial transcriptome data. Here data1_f and data2_f belongs to control while data3_f and data4_f belong to inflammed group. I applied following step for the batch correction by Harmony (based on the sample id).
Each sample was analysed for SCTransform -> merged for single seurat object -> RunPCA -> RunHarmony -> RunUMAP
object <- merge(data1_f, y=c(data2_f,data3_f,data4_f), add.cell.ids = c("Donor1","Donor2","Donor3","Donor4"), project = "pbmc_combined")
pancreas.list <- SplitObject(object = object, split.by = "orig.ident" )
for (i in 1:length(pancreas.list)) {
pancreas.list[[i]] <- SCTransform(pancreas.list[[i]], verbose = FALSE,assay = "Spatial")
}
pancreas.features <- SelectIntegrationFeatures(object.list = pancreas.list, nfeatures = 3000)
c1 <- pancreas.list[[1]]
d1 <- pancreas.list[[2]]
a1 <- pancreas.list[[3]]
b1 <- pancreas.list[[4]]
pancreas_merged <- merge(x=c1, y = c(d1,a1,b1), project = "pancreas", merge.data = TRUE)
VariableFeatures(pancreas_merged) <- pancreas.features
pancreas_merged <- RunPCA(object = pancreas_merged, assay = "SCT", npcs = 50)
pancreas_merged <- RunHarmony(object = pancreas_merged,
assay.use = "SCT",
reduction = "pca",
dims.use = 1:50,
group.by.vars = "orig.ident",
plot_convergence = TRUE)
pancreas_merged <- RunUMAP(object = pancreas_merged, assay = "SCT", reduction = "harmony", dims = 1:50)
After batch correction, I was expecting overlapped cluster from both the groups. But it give me two distinct cluster based on the condition. I suppose I am doing something wrong during the analysis. I would appreciate all the suggestion.
Have you tried merge the objects first and then perform SCTransform?