Inverting order of groups when using DESeq2
1
0
Entering edit mode
@marcelo-pereira-6541
Last seen 8.7 years ago

Hello, 

When using DESeq2, does it matter the order of the groups of samples we feed to this package?

From some preliminary test runs, if I test Group1 against Group2, and then Group2 against Group1, I can see that the base means are the same for all genes, but the log2FoldChange has its sign inverted.  This behavior makes sense to me, but I would like to know the mathematical/statistical rationale for this outcome using this package.

Thanks,
Marcelo

 

 

 

 

 

DESeq2 Galaxy • 1.3k views
ADD COMMENT
0
Entering edit mode
@mikelove
Last seen 4 days ago
United States

hi Marcelo,

This is something particular to the DESeq2 Galaxy wrapper. It is choosing which of the groups should be in the denominator of the log fold change based on the order you provided the files.

If you run DESeq2 in R, and do not specify which should be the "reference level" explicitly, it is chosen alphabetically. 

From the DESeq2 vignette:

"Note on factor levels

By default, R will choose a reference level for factors based on alphabetical order. Then, if you never tell the DESeq2 functions which level you want to compare against (e.g. which level represents the control group), the comparisons will be based on the alphabetical order of the levels. There are two solutions: you can either explicitly tell results which comparison to make using the contrast argument (this will be shown later), or you can explicitly set the factors levels. "

ADD COMMENT
0
Entering edit mode

Additionally, you asked if anything else should change, and the answer is no: swapping the groups should only change the sign of the LFC. 

ADD REPLY

Login before adding your answer.

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