美文网首页单细胞学习
seurat v5整合步骤报错处理

seurat v5整合步骤报错处理

作者: myshu | 来源:发表于2024-06-06 15:22 被阅读0次

    参考: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
    )
    

    运行的mnnscvi方法的时候报错:

    mnn报错

    结果办法就是在运行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会跑的慢一些。

    相关文章

      网友评论

        本文标题:seurat v5整合步骤报错处理

        本文链接:https://www.haomeiwen.com/subject/luwpqjtx.html