Yes. When you specify the contrast, it doesn't matter what you set as the reference with relevel.
DESeq2
Hi,
I am really confused with DESeq2. I only have normal and virus samples. I would like to see upregulated genes in virus samples
dds <-DESeqDataSetFromMatrix(countData = round(count_matrix), colData = col_matrix,
design = ~treatment )
I set my reference level by
dds$treatment<-relevel(dds$treatment,ref="normal")
Then I set the constrast after I run the deseq2
contrast1 <- c('treatment',"normal" ,"virus")
I would like to get results for log2foldchange.
comparison_df <-results(dds, contrast = contrast1, alpha = 0.1)
Here, I get the genes I am interested as -log2foldchange values. What I know is they were supposed to be positive.
Could you help me to understand what I am doing wrong? Thank you.
• 1,082 views
•
link
1 answer
In DESeq2, condition treated vs untreated is calculated as log2(treated/untreated) so,
res <- results(dds, contrast=c("condition", "treated", "untreated"))
So I think in your case it should be:
contrast=c("treatment", "virus", "normal")
it the normal level is your reference level.
• 0 views
•
link
• 0 views
•
link
Log in to answer this question.