Incorporating 'offset' into edgeR pipeline
Entering edit mode
alakatos ▴ 110
Last seen 2.1 years ago
United States

Hello All,

I would like to adjust my RNAseq dataset for GC content.

I used EDASeq to calculate the offset.


data <-newSeqExpressionSet(counts=as.matrix(d$counts),featureData=feature,phenoData=data.frame(pheno),row.names=rownames(d))
dataOffset <- withinLaneNormalization(data,"gc", which="full",offset=TRUE)
offset <- offst(dataOffset)

My goal is to incorporate “GC offset” into my edgeR pipeline  (not to override edgeR calculated offset).

I found some suggestions online but I am not sure I am doing right.

Large logCPM values when using offsets in edgeR for normalization

[bioc] correlation analysis of RNA-seq


d <- calcNormFactors(d, robust=TRUE, method ="TMM", offset=offset)
d <- estimateDisp(d, design,)
fit <- glmFit(d, design)



Would you please advise?

Thanks a lot,


edgeR EDASeq offset • 658 views
Entering edit mode
Aaron Lun ★ 27k
Last seen 17 hours ago
The city by the bay

Supplying offset to calcNormFactors will do nothing, see ?calcNormFactors.

If you need to supply offsets to edgeR, use the scaleOffset function to store the offset matrix inside the DGEList. This will ensure that the offsets are interpretable as log-library sizes (natural log), which is necessary for sensible calculation of the average log-CPM.

However, any specification of the offset matrix will override the use of normalization factors in downstream calculations. There is no straightforward way to "combine" offset matrices with the TMM normalization factors. edgeR can't possibly know what biases are removed by your offset matrix; it just assumes that you know what you're doing, and that the offset matrix gets rid of all biases that might be relevant to your contrasts of interest.

In short, supplying the EDAseq offset matrix will mean that only the EDAseq normalization will be performed. The TMM normalization factors will be mostly ignored for the purposes of DE testing.


Login before adding your answer.

Traffic: 358 users visited in the last hour
Help About
Access RSS

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6