limma and edgeR will give usually give very similar results if the same model is fitted in both packages.
edgeR is often a bit more powerful, but only slightly so.
See Baldoni et al (2025) for a comparison of the two pipelines.
Your voom code doesn't look quite correct. I would also keep all the data together rather than subsetting to males and females, especially if you want to estimate a random effect. limma and edgeR can estimate sex-specific condition effects without needing to subset the data.
Here is suggested code:
Design matrix using all data.
Here, dge
is a DGEList:
dge <- normLibSizes(dge)
Condition <- relevel(sampleinfo$Condition, ref="control")
Sex <- sampleinfo$Sex
design <- model.matrix(~ Sex + Sex:Condition)
edgeR case vs control for females:
fitq <- glmQLFit(dge, design, robust=TRUE)
CasevsControl.F <- glmFTest(fitq, coef="SexF:Conditioncase")
summary(decideTests(CasevsControl.F, p=0.1))
edgeR case vs control for males:
CasevsControl.M <- glmFTest(fitq, coef="SexM:Conditioncase")
summary(decideTests(CasevsControl.M, p=0.1))
limma case vs control for females and males:
fitv <- voomLmFit(dge, design)
fitv <- eBayes(fitv, robust=TRUE)
summary(decideTests(fitv, p=0.1))
limma case vs control for females and males, with random effect for cage
fitv <- voomLmFit(dge, design, block=sampleinfo$cage)
fitv <- eBayes(fitv, robust=TRUE)
summary(decideTests(fitv, p=0.1))
Note there is no need for estimateDisp
and that voomLmFit
calls duplicateCorrelation
automatically.
Including cage as a random effect will almost certainly decrease the number of DE genes, because it will (correctly) decrease the effective number of independent samples.
Reference
Baldoni PL#, Chen L#, Li M, Chen Y, Smyth GK (2025). Dividing out quantification uncertainty enables assessment of differential transcript usage with diffSplice. bioRxiv. https://doi.org/10.1101/2025.04.07.647659
This was asked before: https://support.bioconductor.org/p/115282/#115285
Thank you!!
if you want to put data just put the data frame instead of pictures