A doubt that came to me when playing with the data made me very nervous about it, follow me:
Looking into the DESeq2 manual you can see:
it is important that "control" or "untreated" level as the first element ("reference level"), so that the log2 fold changes produced by default will be the expected comparison against the reference level, that is log2 (treated/untreated).
I checked and my Deseq2 object is fine, with untreated/control as the first element
So, when Experimental group has lower reads than Control, you expect negative log2foldchanges. And when experimental is bigger than Control you expect positive log2foldchanges. So I think it is fine to separate(TRUE/FALSE) them in my dataset like this:
Cresultado$up <- Cresultado$log2FoldChange > 1 & Cresultado$padj < 0.01
Cresultado$down <- Cresultado$log2FoldChange > -1 & Cresultado$padj < 0.01
The problem is, when looking in the raw read counts, every gene maked as upregulated has experimental group with lower reads than control and vice-versa. like this:
gene_id log2foldchange
ENSMUSG00000068606 -9.316849 Downregulated
But is pretty up-regulated below
Control_1 Experimental
ENSMUSG00000068606 15 18145
Control_2
ENSMUSG00000068606 19 15001
Control_3
ENSMUSG00000068606 9 18767
The same occurs with other IDs
Can someone enlighten me?
The part of the manual you were reading before only applies to when one simply extracts the coefficient, rather than making a contrast.