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
這個報錯的原因是細(xì)胞數(shù)量太多導(dǎo)致矩陣太大,在monocle2中會發(fā)生報錯。有兩個解決方案:
- 1.更新使用monocle3軟件(推薦)。
- 2.減少用于擬時序分析的細(xì)胞數(shù)量或者特征數(shù)量。代碼示例如下:
# sce是矩陣
monocle.matrix <- as.matrix(sce@assays$RNA@counts[disp.genes, ], 'sparseMatrix') # 事先使用高變基因或特定基因進(jìn)行提取
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