参考:https://satijalab.org/seurat/articles/seurat5_integration
有seurat v5中有5种数据整合方法可以选择,其中scVI是需要在同一个conda 环境中新装一个环境的。
- Anchor-based CCA integration (method=CCAIntegration)
- Anchor-based RPCA integration (method=RPCAIntegration)
- Harmony (method=HarmonyIntegration)
- FastMNN (method= FastMNNIntegration)
- scVI (method=scVIIntegration)
obj <- IntegrateLayers(
object = obj, method = CCAIntegration,
orig.reduction = "pca", new.reduction = "integrated.cca",
verbose = FALSE
)
obj <- IntegrateLayers(
object = obj, method = RPCAIntegration,
orig.reduction = "pca", new.reduction = "integrated.rpca",
verbose = FALSE
)
obj <- IntegrateLayers(
object = obj, method = HarmonyIntegration,
orig.reduction = "pca", new.reduction = "harmony",
verbose = FALSE
)
obj <- IntegrateLayers(
object = obj, method = FastMNNIntegration,
new.reduction = "integrated.mnn",
verbose = FALSE
)
obj <- IntegrateLayers(
object = obj, method = scVIIntegration,
new.reduction = "integrated.scvi",
conda_env = "../miniconda3/envs/scvi-env", verbose = FALSE
)
运行的mnn
和scvi
方法的时候报错:
结果办法就是在运行IntegrateLayers
之前,导入SeuratWrappers
包即可。
如下:
library(SeuratWrappers)
combined <- IntegrateLayers(
object = combined, method = FastMNNIntegration,
new.reduction = "integrated.mnn",
verbose = FALSE
)
library(SeuratWrappers)
combined <- IntegrateLayers(
object = combined, method = scVIIntegration,
new.reduction = "integrated.scvi",
conda_env = "/miniconda3/envs/scvi-env/", verbose = FALSE
)
注意,每次选一种方法整合即可,还有就是scvi会跑的慢一些。
网友评论