Monocle2拟时序报错:Error in orderCells: long vectors not supported yet

Error in orderCells: long vectors not supported yet

报错的具体信息:

cds <- orderCells(cds)
# Error in graph.adjacency.dense(adjmatrix, mode = mode, weighted = weighted, :
# long vectors not supported yet: ../../src/include/Rinlinedfuns.h:138
# Calls: orderCells ... project2MST -> graph.adjacency -> graph.adjacency.dense -> .Call

这个报错的原因是细胞数量太多导致矩阵太大,在monocle2中会发生报错。有两个解决方案:

  • 1.更新使用monocle3软件(推荐)。
  • 2.减少用于拟时序分析的细胞数量或者特征数量。代码示例如下:
# sce是矩阵
monocle.matrix <- as.matrix(sce@assays$RNA@counts[disp.genes, ], 'sparseMatrix') # 事先使用高变基因或特定基因进行提取
monocle.sample <- sce@meta.data
monocle.geneAnn <- data.frame(gene_short_name = row.names(monocle.matrix), row.names = row.names(monocle.matrix))
monocle.geneAnn$gene_kk_name <- monocle.geneAnn$gene_short_name
data <- as(as.matrix(monocle.matrix), 'sparseMatrix')
pd <- new("AnnotatedDataFrame", data = monocle.sample)
fd <- new("AnnotatedDataFrame", data = monocle.geneAnn)
cds <- newCellDataSet(data, phenoData = pd, featureData = fd)

参考链接

https://github.com/cole-trapnell-lab/monocle-release/issues/138

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容