參考:https://satijalab.org/seurat/articles/seurat5_integration
有seurat v5中有5種數(shù)據(jù)整合方法可以選擇扎拣,其中scVI是需要在同一個conda 環(huán)境中新裝一個環(huán)境的煞聪。
- 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
)
運(yùn)行的mnn
和scvi
方法的時(shí)候報(bào)錯:
結(jié)果辦法就是在運(yùn)行IntegrateLayers
之前羽杰,導(dǎo)入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會跑的慢一些羹奉。