edgeR 4.2.1 compression bug: a minimally reproducible snippet
1
0
Entering edit mode
Hongjian • 0
@15e32360
Last seen 27 days ago
United States

Context: I've been doing some in silico research involving large-scale simulations with various DGE packages. I detected an error (detailed below) in my simulations that seemed new to edgeR 4.2.1 and did not occur in earlier versions.

The following example might involve some non-sensical data, but I was able to reduce the original, meaningful, large-scale simulation dataset to this 3 by 3 one for debugging convenience.

count <- data.frame( c1=c(2,0,0), c2=c(1,2,4), c3=c(2,0,1))
norms <- c(0.65001, 1, 1.7)
groups <- c('case', 'control', 'case')
genes <- c('G1', 'G2', 'G3')
libsize <- c(1,1,1)
library(edgeR)
dglist <- DGEList(count, libsize, norms, group=groups, genes=genes )
library(stats)
dm <- model.matrix( ~ groups )
dglist <- estimateGLMCommonDisp(dglist, design=dm)
dglist <- estimateGLMTrendedDisp(dglist, design=dm)
dglist <- estimateGLMTagwiseDisp(dglist, design=dm)
fit <- glmQLFit(dglist, dm)

And this leads to the error:

Error in .compressOffsets(y, lib.size = lib.size, offset = offset) :
  offsets must be finite values

Some further observations:

  • Weird enough, if "0.65001" was changed into "0.65", there wouldn't be any such error and the GLM fit would go through.
  • If "4" in the count matrix was changed into "3", there wouldn't be this error.
  • A cursory dive into the source code tells me that in .compressOffsets(), the offset is obtained from getOffset(dglist), which is completely specified by my inputs and should be equal to log(norms). Indeed, if I enter getOffset(dglist), I get the correct values -0.4307814 0.0000000 0.5306283. The error here, however, is only supposed to be raised when these offsets are infinite.
  • This happens with edgeR version 4.2.1 on both my local PC (Windows) and server (Linux). But this did not happen with earlier version 4.0.x, as I remember.

Regards,

Hongjian

hjnwang [at] cmu [dot] edu

edger edgeR • 286 views
ADD COMMENT
4
Entering edit mode
@gordon-smyth
Last seen 2 hours ago
WEHI, Melbourne, Australia

Thanks very much for the reproducible example. The bug has been fixed now in edgeR 4.3.17 on the Bioconductor developmental repository and in edgeR 4.2.2 on the release repository.

ADD COMMENT

Login before adding your answer.

Traffic: 344 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