[BioC] DESeq2: up- and down-regulated genes

Simon Anders anders at embl.de
Mon May 26 17:42:50 CEST 2014


Hi Alicia

On 26/05/14 17:20, Alicia R. Pérez-Porro wrote:
>  1. MostSigGenes.txt, DownRegulated.txt and UpRegulated.txt always have
>     the same number of genes. This is confusing for me.

This is because in all three cases, it is the same table. You only 
change the ordering of rows.

Here, you take the table with all genes ("res") and reduce it to only 
those rows with padj < 0.1:

 > resSig <- res[ which(res$padj < .1), ]

and in your "write.table" commands, you always write out this table, but 
you re-order the rows. (The "order" function gives the order of rows to 
get them sorted according to what you specify)

>  2. I understand then that maybe is better to only generate
>     MostSigGenes.txt and then divide the result in 2 txt files: one with
>     positive log2FC = upregulated and the other with negative log2FC =
>     downregulated, right?

Probably, yes.

Depends, though, on what you want to do with the text files afterwards. 
If you want to look at them in Excel and this is the tool you feel most 
comfortable with, you could also simply write out the "resSig" table as 
is, with
   write.table( resSig, file="allSig.txt" )
or even the whole result table ('res' isntead of 'resSig') and do all 
your filtering and sorting in Excel.


>  3. I don't understand with if I am entering the conditions like
>     "condition = factor(c("SP", "SP", "EB", "EB")))" then is comparing
>     EB vs. SP. I would have thought the opposite.

R has the habit of sorting the names of the factor level by alphabet if 
you don't explicitly tell it the order you want. And then, DESeq2 
compares by default the alphabetically last versus the first.

If you want something else, just tell it what you want:

   res <- results( dds, contrast = list( "condition", "EP", "SP" ) )

to compare SP versus EP.

   Simon



More information about the Bioconductor mailing list