• invalid class “Graph” object: superclass "Mnumeric" not defined


    > scRNA <- FindNeighbors(scRNA, dims = pc.num) 
    Computing nearest neighbor graph
    Computing SNN
    Error in validObject(.Object) : 
      invalid class “Graph” object: superclass "Mnumeric" not defined in the environment of the object's class

    Seurat执行FindNeighbor出现
    invalid class “Graph” object: superclass "Mnumeric" not defined in the environment of the object's class



    原因是 Matrix package (1.3-3) 新版本不兼容,解决方法就是降级到1.3-2

    首先,我们需要卸载当前的Matrix
    remove.packages("Matrix")

       
    然后从存档里安装旧版本的Matrix
    packageurl <- "https://cran.r-project.org/src/contrib/Archive/Matrix/Matrix_1.3-2.tar.gz"
    install.packages(packageurl, repos=NULL, type="source")


    国内用户可以用情况镜像源 (文件也就是1.9Mb, 应该不需要用到国内镜像进行加速)
    packageurl <- "https://mirrors.tuna.tsinghua.edu.cn/CRAN/src/contrib/Archive/Matrix/Matrix_1.3-2.tar.gz"
    install.packages(packageurl, repos=NULL, type="source")


    然后测试下, 发现问题已经解决了。

    library(Seurat)
    pbmc_small <- FindNeighbors(pbmc_small, reduction = "pca", dims = 1:10)


    > library(Matrix)
    Error in value[[3L]](cond) : 
      Package ‘Matrix’ version 1.3.3 cannot be unloaded:
     Error in unloadNamespace(package) : namespace ‘Matrix’ is imported by ‘DelayedMatrixStats’, ‘mgcv’, ‘sctransform’, ‘SummarizedExperiment’, ‘irlba’, ‘BiocNeighbors’, ‘uwot’, ‘Seurat’, ‘rsvd’, ‘reticulate’, ‘BiocSingular’, ‘DelayedArray’, ‘leiden’, ‘survival’, ‘spatstat.data’, ‘spatstat’, ‘scater’ so cannot be unloaded
    
     
     



    参考资料
    https://github.com/satijalab/seurat/issues/4436
  • 相关阅读:
    docker 容器
    web开发相关工具总结
    Linux] Git: push 出错的解决 master -> master (branch is currently checked out)
    MongoDB
    vs code 快捷键
    flutter 实现圆角头像的2种方法
    Flutter web环境变量搭建及开发
    使用VS Code调试Flutter(检查用户页面)
    Flutter走过的坑(持续更新)
    react link引入外部css样式的坑
  • 原文地址:https://www.cnblogs.com/emanlee/p/14924558.html
Copyright © 2020-2023  润新知