Extract Limma Adjusted Values for Plotting
1
0
Entering edit mode
phelankj • 0
@c526a81b
Last seen 5 days ago
United States

Hello, I had a question about extracting covariate-corrected normalized count values from limma (if possible) for box plots. Essentially, I have some genes which limma labels as differentially expressed when covariates are corrected for in the model, but when I pull the voom-normalized counts to visualize expression differences as boxplots between conditions they do not represent the output of the limma model. I imagine this is because the normalized counts are not corrected for any covariates as they are in the model, which is why the differences in expression are not apparent. I'm not sure it is needed but here is the relevant code:

mm <- model.matrix(~1, data = dat.abund.norm$samples)

dat.abund.norm.voom <- voomWithQualityWeights(
  dat.abund.norm,
  design=mm,
  plot=TRUE)

mm <- model.matrix(~PREDICTEDCLASS +
                     WBC +
                     Epithelial +
                     SiteID +
                     Plate, 
                   data = dat$targets)

y2 <- lmFit(dat, mm)

fit2 <- eBayes(y2, trend = TRUE)

top.table_WGCNA <- topTable(fit2, coef = c(2,3,4), n = "Inf")
limma • 1.0k views
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 2 days ago
United States

You should use removeBatchEffect for that.

ADD COMMENT
0
Entering edit mode

Thanks, on the normalized values using the same formula?

ADD REPLY
0
Entering edit mode

Yes, with normalized counts on log2 scale.

ADD REPLY

Login before adding your answer.

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