使用edger做差异分析时出现Error in DGEList(counts = data, group = group) : Length of 'group' must equal number of columns in 'counts'怎么解决

foldChange=2

padj=0.01


setwd("E:/shengyi/shuju/111")                    #设置工作目录

library("edgeR")

rt=read.table("miRNA_symbol.txt",sep="\t",header=T,check.names=F)  #改成自己的文件名

rt=as.matrix(rt)

rownames(rt)=rt[,1]

exp=rt[,2:ncol(rt)]

dimnames=list(rownames(exp),colnames(exp))

data=matrix(as.numeric(as.matrix(exp)),nrow=nrow(exp),dimnames=dimnames)

data=avereps(data)

data=data[rowMeans(data)>1,]


group=c(rep("normal",46),rep("tumor",519))                         #按照癌症和正常样品数目修改

design <- model.matrix(~group)

y <- DGEList(counts=data,group=group)

到这一步时就报错Error in DGEList(counts = data, group = group) :    Length of 'group' must equal number of columns in 'counts'

请先 登录 后评论