Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Is It Feasible to Use Harmony Directly for Batch Correction in Seurat V5 Instead of “ IntegrateLayers“?" #249

Open
Tylesteven opened this issue Apr 20, 2024 · 5 comments

Comments

@Tylesteven
Copy link

Tylesteven commented Apr 20, 2024

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?

@ptranvan
Copy link

Hi @Tylesteven , I am wondering the same thing.

Did you find any solution ?

@Tylesteven
Copy link
Author

Tylesteven commented May 27, 2024 via email

@ptranvan
Copy link

After merging, I have an object with multiple layers:

Active assay: RNA (33654 features, 2000 variable features)
 27 layers present: counts.1, counts.2, counts.3, counts.4, counts.5, counts.6, counts.7, counts.8, counts.9, data.1, scale.data.1, data.2, scale.data.2, data.3, scale.data.3, data.4, scale.data.4, data.5, scale.data.5, data.6, scale.data.6, data.7, scale.data.7, data.8, scale.data.8, data.9, scale.data.9

Did you have also the same object ? how have you dealt with it ?

@Tylesteven
Copy link
Author

Tylesteven commented May 27, 2024 via email

@ptranvan
Copy link

Before or after merging ?

Would you mind to share your code please ?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants