Incorporating 'offset' into edgeR pipeline
1
0
Entering edit mode
alakatos ▴ 130
@alakatos-6983
Last seen 5.2 years ago
United States

Hello All,

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

I used EDASeq to calculate the offset.

Code

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

https://support.bioconductor.org/local/search/page/?q=offset

[bioc] correlation analysis of RNA-seq

Code

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

summary(decideTests(lrt))
topTags(lrt)

 

Would you please advise?

Thanks a lot,

Anita

edgeR EDASeq offset • 1.9k views
ADD COMMENT
0
Entering edit mode
Aaron Lun ★ 28k
@alun
Last seen 54 minutes 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.

ADD COMMENT

Login before adding your answer.

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