在运行此代码时报错,请问如何解决?感谢!
expr_matrix <- as(as.matrix(seurat_object_cluster@assays$RNA@counts), 'sparseMatrix')
f_data <- data.frame(gene_short_name = row.names(seurat_object_cluster),row.names = row.names(seurat_object_cluster))
pd <- new('AnnotatedDataFrame', data =seurat_object_cluster@meta.data)
fd <- new('AnnotatedDataFrame', data = f_data)
#将p_data和f_data从data.frame转换AnnotatedDataFrame对象。
cds <- newCellDataSet(expr_matrix,
phenoData = pd,
featureData = fd,
lowerDetectionLimit = 0.5,
expressionFamily = negbinomial.size())
我发现在seurat_object_cluster中的counts是33231 x 45183,而f_data提取出来的是2000,是否是这里出现的问题,求教如何解决?