Search
Question: edgeR - problem with glmQLFTest()
0
gravatar for david.powell
3 months ago by
david.powell0 wrote:

Greetings,

I'm getting the following error when calling glmQLFTest()

> qlf <- glmQLFTest(fit,contrast=cont.matrix)
Error in data.frame(logFC = logFC, logCPM = glmfit$AveLogCPM, LR = LR,  :
  'row.names' should specify one of the variables

> traceback()
4: stop("'row.names' should specify one of the variables")
3: data.frame(logFC = logFC, logCPM = glmfit$AveLogCPM, LR = LR, 
       PValue = LRT.pvalue, row.names = rn)
2: glmLRT(pois.fit, coef = coef, contrast = contrast)
1: glmQLFTest(fit, contrast = cont.matrix)

I think the error is due to the call to  .isBelowPoissonBound() only returning a single row for my data set.   My guess is that the problem is that in glmLRT() the call

logFC <- drop((glmfit$coefficients %*% contrast)/log(2))

will produce a vector rather than a matrix, which eventually results in the error from data.frame().

I have an example data set & code at this gist https://gist.github.com/drpowell/ac473045cfea8b489d49e645d3239a53#file-dge-r

Thanks,

-- David

 

ADD COMMENTlink modified 3 months ago by Gordon Smyth32k • written 3 months ago by david.powell0

Please put the table somewhere else, it's expanding the whole ~2000 rows onto the page.

ADD REPLYlink written 3 months ago by Aaron Lun18k

I've edited the gist URL so that it shows as a link instead of inserting the whole dataset.

ADD REPLYlink written 3 months ago by Gordon Smyth32k
1
gravatar for Aaron Lun
3 months ago by
Aaron Lun18k
Cambridge, United Kingdom
Aaron Lun18k wrote:

A simpler reproducible example is this:

library(edgeR)
example(glmFit)
glmLRT(fit[1,], contrast=diag(2))

... and yes, it is caused by drop when computing logFC. The simplest solution would be to just get rid of drop; if we want a vector (e.g., when there is only one coefficient to test), we can just coerce it directly.

ADD COMMENTlink modified 3 months ago • written 3 months ago by Aaron Lun18k
1
gravatar for Gordon Smyth
3 months ago by
Gordon Smyth32k
Walter and Eliza Hall Institute of Medical Research, Melbourne, Australia
Gordon Smyth32k wrote:

Thanks David. I have committed a fix to edgeR 3.20.1 for Bioconductor 3.6.

ADD COMMENTlink written 3 months ago by Gordon Smyth32k
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.2.0
Traffic: 439 users visited in the last hour