Description
I have multiple samples from various GEO datasets that need batch correction. Currently, I've created five Seurat objects in Seurat V5 and merged them into a single object. I would like to perform the batch correction not using the built-in method in Seurat V5, which is:
#============================
merged_sce <- merge(sce_GSE140393_DRE, y = list(sce_GSE148822_AD, sce_GSE157827_AD, sce_GSE160189_DRE, sce_GSE173731_DRE, sce_GSE174367_AD),
add.cell.ids = c("GSE140393_DRE", "GSE148822_AD", "GSE157827_AD", "GSE160189_DRE", "GSE173731_DRE", "GSE174367_AD"),
project = "Merged_All")
sce <- NormalizeData(merged_sce ) %>% FindVariableFeatures(selection.method = "vst",nfeatures = 3000)%>% ScaleData(vars.to.regress=c("percent.mt","nCount_RNA")) %>% RunPCA(npcs = 30, verbose = T)
sce_harm <- IntegrateLayers(object = sce,
method = HarmonyIntegration,
orig.reduction = "pca",
new.reduction = "integrated.Harmony",
verbose = TRUE)
Instead, I want to use Harmony directly with the following code:
sce_harm <- RunHarmony(sce, group.by.vars = c("dataset", "donor", "batch_id"))
The variables "dataset", "donor", "batch_id" are included in my metadata. Is this approach feasible?