问题:
在用R语言中的monocle进行拟时序分析时,在画拟时许图的前一步细胞排序时报错,怎么办?
问题相关代码:
**sc_cds2 <- orderCells(sc_cds2)**
运行结果及报错内容
Error in if (class(projection) != "matrix") projection <- as.matrix(projection) :
the condition has length > 1
In addition: Warning message:
In graph.dfs(dp_mst, root = root_cell, neimode = "all", unreachable = FALSE, :
Argument neimode' is deprecated; use mode' instead
前边的步骤也报错过,就是建立monocle的对象newCellDataSet,也报错过,后来问了别人是因为matrix构建的不对,代码如下
sc_cds_2 <- newCellDataSet(matrix, phenoData = pd,featureData =fd,expressionFamily = negbinomial.size(),lowerDetectionLimit=0.01)
把matrix<-as.sparse(mmt@assays$RNA@counts)
改成matrix<-as.sparse(mmt@assays$RNA@counts)
后就好了。据说因为R版本的问题,函数的功能有些变动。