Question: Multiple differential expression analyses with DESeq2
gravatar for jonas
12 months ago by
jonas0 wrote:

I have a RNA-Seq dataset and want to test differential gene expression with DESeq2 for just some of the genes but for many different phenotypes. Now I have 3 questions:

  1. I have to give DESeq all the genes and then only subset the results to the genes of interest, correct?
  2. The most time-consuming step seems to be the dispersion estimation. Is this dependent on the design matrix, i.e. the phenotype? Or is there a way to correct for dispersion once and then perform the differential expression test for multiple phenotypes on the same normalized dataset?
  3. If 2 is possible: Can I do the testing for only some of the genes after I normalised the dataset with all the genes?
ADD COMMENTlink modified 12 months ago by Michael Love20k • written 12 months ago by jonas0
gravatar for Michael Love
12 months ago by
Michael Love20k
United States
Michael Love20k wrote:

1) yes 2) do you mean comparing groups? Take a look at the ‘contrast’ argument in this help file:


3) if you have prespecifed the genes before you look at the data, then yes you could recompute BH adjustment just on your genes of interest, but peeking at the data first and then choosing the set of genes will lead to inflation of false positives.

ADD COMMENTlink written 12 months ago by Michael Love20k

2) no I mean actually different phenotypes, i.e. different variables each of them with 2 groups. Could I normalise like with this:

dds <- DESeqDataSetFromMatrix(countData = mycounts, colData = mycoldata, design = ~1) 
dds  <- estimateSizeFactors(dds)
dds  <- estimateDispersions(dds)

And then do the tests for each phenotype with

for(p in phenos)
design(dds) = as.formula(~pheno)
## only test genes of interest
dds2 = dds[genes.of.interest, ]
res  <- nbinomWaldTest(dds2)
##save results here

3) yes, I know, I actually have only few genes of interest. But if I subset the genes after the normalisation and before the differential expression test like this?

dd  <- estimateSizeFactors(dd)
dd  <- estimateDispersions(dd)
dd  <- dd[genes.of.interest, ]
dd  <- nbinomWaldTest(dd)   
ADD REPLYlink written 12 months ago by jonas0

No you can't change the design after calculating dispersion. The dispersion only make sense relative to a certain design.

Imagine, if you set ~1, and you have a gene with DE across two groups of samples. You will get a high dispersion estimate, because the design doesn't allow for different mean counts for the two groups. Then you switch to ~condition, you would get a lower dispersion estimate.

Yes, you can subset before differential expression testing.

ADD REPLYlink written 11 months ago by Michael Love20k

ok, thanks!

ADD REPLYlink written 11 months ago by jonas0
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 365 users visited in the last hour