edgeR: no residual df: Cannot estimate dispersion
1
2
Entering edit mode
7.6 years ago
dec986 ▴ 370

Hello,

I have a data set looking like this:

Gene Symbol a1  a2  b1  b2
Prss12  475 347 342 367
2010008C14Rik   3   0   0   0
Gm10819 216 129 164 126
Gm2245  25  23  14  28

and I am loading into EdgeR with the following script:

#!/usr/bin/R
counts = read.table("gene_count.tsv",sep="\t",row.names=1,header=T)
group <- c("a1","a2","b1","b2")
gene_or_transcript <- "genes_"#for filenames so I know what I'm reading
countS = counts[,1:dim(counts)[2]]
library(edgeR)
#now we'll do the DGEList command
y = DGEList(counts=counts[,1:dim(counts)[2]] ,gene=row.names(counts))#counts=counts[,2:dim(counts)[2]] removes $Gene.Symbol, i.e. 1st column
o<-order(rowSums(y$counts),decreasing=TRUE)#remove duplicates
y<-y[o,]
d<-duplicated(y$genes)
y<-y[!d,]
y$samples$lib.size <- colSums(y$counts)
rownames(y$counts) <- t(y$gene)# exchange ID
y<-calcNormFactors(y)
data.frame(Sample=colnames(y),group)
design<- model.matrix(~0+group)
#
y<-estimateGLMCommonDisp(y,design, method = 'deviance')
y<-estimateGLMTrendedDisp(y,design)
y<-estimateGLMTagwiseDisp(y,design)

but this produces an error

"Error in return(NA, ntags) : multi-argument returns are not permitted
In addition: Warning messages:
1: In estimateGLMCommonDisp.default(y = y$counts, design = design,  :
  No residual df: setting dispersion to NA
2: In estimateGLMTrendedDisp.default(y = y$counts, design = design,  :
  No residual df: cannot estimate dispersion"

why is this error produced? how can I fix it? I don't see anything in the EdgeR manual about it.

thanks, -DEC

edgeR • 12k views
ADD COMMENT
3
Entering edit mode
7.6 years ago

You only have 4 samples, you can't then have 4 groups. I presume you meant group <- c("a", "a", "b", "b").

ADD COMMENT
0
Entering edit mode

thank you very much Devon!

ADD REPLY

Login before adding your answer.

Traffic: 2705 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6