DESeq2 degrees of freedom
1
0
Entering edit mode
david.watson ▴ 30
@davidwatson-9545
Last seen 5.9 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 • 2.0k views
ADD COMMENT
1
Entering edit mode
@mikelove
Last seen 11 hours 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.

ADD COMMENT
0
Entering edit mode

Got it. Thanks for the prompt reply!

ADD REPLY
0
Entering edit mode

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

ADD REPLY
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.

ADD REPLY

Login before adding your answer.

Traffic: 616 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6