Question: edgeR: no residual df: Cannot estimate dispersion
2
gravatar for dec986
3.0 years ago by
dec986200
United States
dec986200 wrote:

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 • 4.1k views
ADD COMMENTlink modified 3.0 years ago by Devon Ryan91k • written 3.0 years ago by dec986200
3
gravatar for Devon Ryan
3.0 years ago by
Devon Ryan91k
Freiburg, Germany
Devon Ryan91k 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.0 years ago by Devon Ryan91k

thank you very much Devon!

ADD REPLYlink written 3.0 years ago by dec986200
Please log in to add an answer.

Help
Access

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