DESeq2 degrees of freedom
1
0
Entering edit mode
david.watson ▴ 20
@davidwatson-9545
Last seen 3.0 years ago
Queen Mary University of London

Is there any simple way to extract the degrees of freedom from a DESeqDataSet object that's been through the complete DESeq pipeline?

At first I thought perhaps the empirical Bayes shrinkage augmented the df as it does in limma, but that doesn't appear to be the case judging by the Love et al., 2014 paper. (Still not 100% certain about this.) Then I thought I could just subtract the number of coefficients from the number of samples as you would for any regular regression, but I'm a little confused by the talk of expanded model matrices in the documentation for nbinomWaldTest. It sounds like the default behaviour of the function is to compute coefficients for each level of each factor, in addition to a model intercept. Does that mean that a simple control vs. treatment DESeq analysis for a 10-sample experiment would have 7 degrees of freedom?

deseq2 • 902 views
1
Entering edit mode
@mikelove
Last seen 1 day ago
United States

hi David,

For calculating the residual degrees of freedom, you shouldn't pay attention to the expanded model matrices (anyway these are being moved out of DESeq entirely and into lfcShrink in the next release), but the standard model matrix that is used for the dispersion estimation. This is just ncol(model.matrix(design(dds), colData(dds))). So it would be 8 for 10 samples and two groups.

0
Entering edit mode

Got it. Thanks for the prompt reply!

0
Entering edit mode

Please expand on 'why' these expanded model matrices can be ignored.

0
Entering edit mode

We don’t use expanded model matrices in DESeq2 anymore. The vignette and workflow never use them and they are essentially deprecated.