ClusterGVis icon indicating copy to clipboard operation
ClusterGVis copied to clipboard

获取聚类getClusters报错

Open yuan1027bio opened this issue 1 year ago • 6 comments

在更新完新的安装包之后,在获取聚类数就报错: library(ClusterGVis)

protein <- read.delim('Brain_DEP_Mean_Shrinkage.txt', row.names = 1, check.names = FALSE) protein_matrix <- as.matrix(protein) getClusters(exp =protein_matrix) 错误于factoextra::fviz_nbclust(exp, stats::kmeans, method = "wss"): x should be an object of class matrix/data.frame or an object created by the function NbClust() [NbClust package].

看到友友建议后,删除“exp=”后,运行示例数据data(exps)是可以运行的,但是运行我自己的数据后,出现新的报错: library(ClusterGVis)

protein <- read.delim('Brain_DEP_Mean_Shrinkage.txt', row.names = 1, check.names = FALSE) protein_matrix <- as.matrix(protein) getClusters(protein_matrix) 错误于if (cls == "cell_data_set") {: the condition has length > 1 class(protein_matrix)

考虑到更新的安装包的数据格式可能也更新了,但是没有明白应该调整为什么样的格式呢

yuan1027bio avatar Feb 09 '25 13:02 yuan1027bio

已经解决了,是本身数据的格式问题

yuan1027bio avatar Feb 09 '25 13:02 yuan1027bio

你好,我也遇到同样问题,请问应该修改成什么样的格式

chenheishou avatar Mar 05 '25 07:03 chenheishou

你好,我也遇到同样问题,请问应该修改成什么样的格式

getClusters(exp =protein_matrix),可以把exp换位obj

Wang-Ande avatar Mar 11 '25 13:03 Wang-Ande

半个月前还可以运行,现在就要把“exp =”删除了,直接给dataframe就可以运行了,真是神奇啊

liuchuan111 avatar May 25 '25 00:05 liuchuan111

Thanks to liuchuan111, that works for me!

orange511 avatar Jun 05 '25 13:06 orange511

遇到同样问题了,应该是ClusterGVis,查看getClusters函数,改成obj了,function (obj = NULL, ...) Usage getClusters(obj = NULL, ...)

Yuxia88 avatar Jul 14 '25 07:07 Yuxia88