R 解构错误

R 解构错误,r,R,我正在使用deconstructSigs软件包,当我试图将突变列表转换为正确的输入格式时,出现以下错误: .local(x,…)中出错:“开始”、“结束”和“宽度” 只能在缺少“名称”时指定, 字符向量/因子、字符Rle或因子Rle 这是我的代码: library(deconstructSigs) sigs.input <- mut.to.sigs.input(mut.ref = data, sample.id = "Gen

我正在使用deconstructSigs软件包,当我试图将突变列表转换为正确的输入格式时,出现以下错误:

.local(x,…)中出错:“开始”、“结束”和“宽度” 只能在缺少“名称”时指定, 字符向量/因子、字符Rle或因子Rle

这是我的代码:

library(deconstructSigs)
sigs.input <- mut.to.sigs.input(mut.ref = data, 
                                sample.id = "Gene_Symbol", 
                                chr = "Chromosome", 
                                pos = "Position", 
                                ref = "Reference_Base", 
                                alt = "Alternate_Base")
库(解构)

sigs.input不确定这是否与您的问题相匹配,但我在以“tibble”格式读取数据帧时遇到了相同的问题。对我来说,以下解决了问题:

library(deconstructSigs)
sigs.input <- mut.to.sigs.input(mut.ref = data %>% as.data.frame(), 
                                sample.id = "Gene_Symbol", 
                                chr = "Chromosome", 
                                pos = "Position", 
                                ref = "Reference_Base", 
                                alt = "Alternate_Base")
库(解构)
sigs.input%as.data.frame(),
sample.id=“基因\符号”,
chr=“染色体”,
pos=“Position”,
ref=“Reference\u Base”,
alt=“备用基础”)

如果不知道具体的软件包,就很难看到这里发生了什么,但请检查函数的文档:您似乎使用了错误的软件包,可能是因为输入数据的格式错误,也可能是因为您提供了错误的参数。