I have an RNA-seq dataset comprising four samples, each with corresponding control and treatment, resulting in a total of eight RNA-seq datasets: sample1_control, sample1_treatment, sample2_control, sample2_treatment, and so on. My objective is to identify differentially expressed genes (DEGs) using a pairwise approach in edgeR.
Essentially, I adhered to the guidelines provided in the edgeR manual, which can be found at https://bioconductor.org/packages/release/bioc/vignettes/edgeR/inst/doc/edgeRUsersGuide.pdf, specifically starting from page 45. The following is my code:
y = DGEList(counts = exprs, genes = rownames(exprs))
keep = rowSums(cpm(y) >=0.1) >= 4
y = y[keep, , keep.lib.sizes = FALSE]
y$samples$lib.size = colSums(y$counts)
y = calcNormFactors(y, method = "TMM", lib.size = y$samples$lib.size)
TMM = cpm(y, normalized.lib.sizes = TRUE, log = FALSE)
Tissue = factor(c("control", "treatment", "control", "treatment", "control", "treatment", "control", "treatment"))
Paired = factor(c("Sample1", "Sample1", "Sample2", "Sample2", "Sample3", "Sample3", "Sample4", "Sample4"))
design = model.matrix(~Tissue + Paired)
y = estimateDisp(y, design, robust = TRUE)
fit = glmFit(y, design)
lrt = glmLRT(fit)
o = order(lrt$table$PValue)
cpm(y)[o[1:5],]
I exported the expression profile of top 5 DEGs:

I observed that the first gene, ENSG00000225217, consistently exhibited up-regulation pattern in the control group across four samples. However, the behavior of the remaining four genes appeared irregular. For instance, the second gene, ENSG00000244682, demonstrated up-regulation in the control group in three out of four samples, showing inconsistency across all sample pairs. This leads me to question whether there is an error in my coding approach, or is it due to the unique characteristics?
Thanks!