This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to set group in EdgeR and DEseq2?

I got a sample sheet like this:

 name condition  
 sampe1    T  
 sampe2    T  
 sampe3    N  
 sampe4    T  
 sampe5    N 
 sampe6    N 
 sampe7   N

(T:tumor, N:normal)

When I use this condition in DEseq2, it will use N vs T as default.

If I set group <- factor(c(1,1,2,1,2,2,2)) in EdgeR. It will get opposite result to DEseq2.

I would like to know. If I want to get the up-down regulated gene in Tumor sample.

Should I set tumor as "1" or "2" in EdgeR ?

rna-seq r edger deseq2

And beware of the using of "T" and "F" as they can be considered as TRUE and FALSE into R

2 answers

It it not important the way you name your factors as long as you can separate and group your samples. You can name factor as letters or as numbers

But at the time of doing the DE analysis, it matters the ORDER you define that factor when the DE analysis is requested. By default, DESEq2 order that factors alphabetically, being used as "control" the first one. You need to use the relevel() function to change your factors if they are not in the order you desire.

In other words. Try to control the way your factors are defined and used in the analysis

Log in to answer this question.