Question: edgeR: no residual df: Cannot estimate dispersion
gravatar for dec986
3.4 years ago by
United States
dec986210 wrote:


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:

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]]
#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$samples$lib.size <- colSums(y$counts)
rownames(y$counts) <- t(y$gene)# exchange ID
design<- model.matrix(~0+group)
y<-estimateGLMCommonDisp(y,design, method = 'deviance')

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 • 4.7k views
ADD COMMENTlink modified 3.4 years ago by Devon Ryan94k • written 3.4 years ago by dec986210
gravatar for Devon Ryan
3.4 years ago by
Devon Ryan94k
Freiburg, Germany
Devon Ryan94k wrote:

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

ADD COMMENTlink written 3.4 years ago by Devon Ryan94k

thank you very much Devon!

ADD REPLYlink written 3.4 years ago by dec986210
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 706 users visited in the last hour