DESeq2: Should lfcShrink require contrast or coef if a results object is supplied?
1
0
Entering edit mode
tdanhorn • 0
@tdanhorn-20452
Last seen 6.0 years ago

I believe something like

res <- results(dds, contrast=c("cond", "A", "B"))`
res.shr <- lfcShrink(dds=dds, res=res, type="normal")

should work, because the res parameter passed to lfcShrink already contains the contrast (or coef) information. Instead it dies with a (cryptic) error message that coefAlpha is missing in a call to results. ?lfcShrink does not say much on the topic, except that contrast and coef are ignored for type="ashr" when res is provided (and for ashr neither contrast nor coef are required). There is also the error message one of coef or contrast required if 'res' is missing, which appears to imply that they are not required when res is supplied.

The way the contrast/coefficient is encoded in the results object requires a bit of a hack (string parsing) to extract it, but that is used elsewhere in the code (and could be changed in a future version). So I see no reason why contrast or coef should be required if res is given (even for for types other than ashr), or am I missing something? In fact, if res is supplied together with a contrast that was not used in the call to results that generated res, wouldn't that lead to weird results (that should warrant at least a warning)?

So my suggestion is fix the code such that res is always sufficient and maybe do sanity checks if contrast or coef is supplied as well. Thanks!

deseq2 • 777 views
ADD COMMENT
0
Entering edit mode
@mikelove
Last seen 10 days ago
United States

What version of DESeq2 are you using? I think this is solved with explicit error messages in the release version.

ADD COMMENT
0
Entering edit mode

I take it back, it was added 2 months ago to the development branch, so it will become release at the end of April.

ADD REPLY
0
Entering edit mode

I think 1.20.1. Good to hear this will be fixed, thanks!

ADD REPLY

Login before adding your answer.

Traffic: 826 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