Hello,
I want to use DESeq2 for DE analysis. I tried to perform a nested comparison. My data has two different factors: the mice are either 1. Uninfected and Infected or 2. Susceptible and Resistant strain. I would like to know how to set the design and contrasts to determine the cell-line specific effect, which consists of:
Resistant.Infected - Resistant.Uninfected vs Susceptible.Infected - Susceptible.Uninfected.
Just to clarify, I am interested in determining those genes which have different gene expression response to infection depending on the mouse strain.
I tried
colData = data.frame(rownames(dataSet$fst.cls), dataSet$sec.cls, dataSet$cls)
view(colData)
condition type condition_type
1 Infected Resistant Infected.Resistant
2 Infected Resistant Infected.Resistant
3 Infected Resistant Infected.Resistant
4 Uninfected Resistant Uninfected.Resistant
5 Uninfected Resistant Uninfected.Resistant
6 Uninfected Resistant Uninfected.Resistant
7 Infected Susceptible Infected.Susceptible
8 Infected Susceptible Infected.Susceptible
9 Infected Susceptible Infected.Susceptible
10 Uninfected Susceptible Uninfected.Susceptible
11 Uninfected Susceptible Uninfected.Susceptible
12 Uninfected Susceptible Uninfected.Susceptible
colnames(colData) = c("condition", "type", "condition_type")
dds = DESeqDataSetFromMatrix(countData=dataSet$data.anot, colData = colData, design = ~condition_type)
dds = DESeq(dds)
resultsNames(dds)
[1] "Intercept" "condition_typeInfected.Resistant"
[3] "condition_typeInfected.Susceptible" "condition_typeUninfected.Resistant"
[5] "condition_typeUninfected.Susceptible"
res = results(dds, contrasts = c(0,1,-1,-1,1))
But when I look into the res file, the only analysis it performed is
"condition_typeInfected.Resistant vs condition_typeUninfected.Susceptible"
I know that this way works but I want to know how to use a more flexible method for design and contrast:
dds = DESeqDataSetFromMatrix(countData=dataSet$data.anot, colData = colData, design = ~type+condition + condition:type)
Thank you in advance.
