Startrac软件分析TCR报错,Error in dcast(cls.tran.index.df, Var2 ~ Var1, value.var = "pIndex.tran")

Startrac软件分析TCR报错,Error in dcast(cls.tran.index.df, Var2 ~ Var1, value.var = "pIndex.tran")

详细错误如下:

[2025-05-08 15:54:50.166619] initialize Startrac ...

[2025-05-08 15:54:52.277085] calculate startrac index ...

[2025-05-08 15:54:53.953071] calculate pairwise index ...

Error in dcast(cls.tran.index.df, Var2 ~ Var1, value.var = "pIndex.tran") :

The dcast generic in data.table has been passed a data.frame, but data.table::dcast currently only has a method for data.tables. Please confirm your input is a data.table, with setDT(cls.tran.index.df) or as.data.table(cls.tran.index.df). If you intend to use a method from reshape2, try installing that package first, but do note that reshape2 is superseded and is no longer actively developed.

这个报错的原因是由于Startrac软件中dcast函数默认使用的是来自于data.table R包中的函数.在最新的data.table(测试过1.17.0)包中该函数只接受data.table数据,不接受data.frame,因此会报错。

将data.table版本降低到1.16.2即可解决该报错(没试过1.16.4)。

posted @ 2025-05-08 16:08  何帅  阅读(140)  评论(0)    收藏  举报