This is a test version of Biostars. For the public version, visit https://www.biostars.org.
different DEGs with different number of sample input.

Recently, I come across an issue that when I directly compare sample A (n=3) and sample B (n=3) using DESeq2, there were only a few DEGs. However, if I add more samples (i.e. C, D, E, F..., n=3) into DESeq2 using DESeqDataSetFromMatrix() and then command results(dds, contrast=c("type","sample A", "sample B")), there will be more DEGs even though I am comparing the same sample type. May I know why this happens?

deseq2

1 answer

This is not an issue, it is a feature. DESeq2 look at all samples to estimate dispersion, i.e., the intrinsic (within-group) variability in gene expression. More samples in the model usually lead to a more accurate dispersion estimate, which can help with finding DEGs.

Usually, it is recommended to include all samples in a given study, even if they are irrelevant to your A vs B comparison (see this manual). However, there are exception when the within-group variability is very different in one group compared to the others.

Log in to answer this question.