This is a test version of Biostars. For the public version, visit https://www.biostars.org.
edgeR glmRT code error message

Hi everyone, I did edgeR to analyze no replicated sample with the following code. Unfortunately, I met some of the problems that I can't fix.

count <- read.table("D:/NDM-12-4/test/Vero.CH.CH-C100.normalisedReadCounts.txt", sep = "\t", header = T, row.names = 1)
view(count)
d1 <- estimateGLMCommonDisp(count, design=NULL, verbose=TRUE)
d2 <- estimateCommonDisp(count, verbose=TRUE)
fit <- glmFit(count,dispersion = 0.26664)
results <- glmLRT(fit, coef=2)

The result shows that

Error in glmLRT(fit, coef = 2) : 
Need at least two columns for design, usually the first is the intercept column

But actually, I put two samples inside the count file. So what does that mean??

r gmlrt edger

Please do not post links to Google Drive files and not even explain why you are doing this.

1 answer

You need to create a design matrix. Why did you set it to NULL?

integer or character vector indicating which coefficients of the linear model are to be tested equal to zero. Values must be columns or column names of design

I highly suggest you read the edger manual it is fantastic.

Dear Mark,

I have the same issue even providing the "designmatrix". I have only one sample for each condition and use the approach below:

designMat <- matrix(1,2,1)
dgList <- estimateGLMCommonDisp(dgList, design=designMat, method="deviance", robust = TRUE, subset=NULL)

fit <- glmFit(dgList)
lrt <- glmLRT(fit)

edgeR_result <- topTags(lrt, n=Inf)

I get "Need at least two columns for design, usually the first is the intercept column" error in lrt <- glmLRT(fit) step. I have tried a lot and do not know how to fix it - could you please help me with this? Thank you.

Like I said above please read the manual. It's impossible to do DE with 1 sample in each condition. You need at minimum 2 samples per condition.

Please read the manual.

Log in to answer this question.