**0**wrote:

Hello ! PhD student and working with rna-seq data, I used DESeq2 for my analysis but after finishing my work, I believe some elements were misunderstood when using the software. To explain I summarized my model analysis: 3 genotypes (G1,G2,G3) in 3 conditions (T1,T2,T3) and my model: I'm interesting by the effect of genotype and treatment but especially by the interaction term in my work. So the design appropriated seem to be:

```
design = formula(~G + B + G:B)
```

Reference factors are : G1 and T1

```
intercept : base mean of G1 in T1 (reference)
G2vsG1 : Genotype 2 against reference G1 in T1
G3vsG1 : Genotype 3 against reference G1 in T1
T2vsT1 : treatment 2 against treatment 1 in T1
T3vsT1 : treatment 3 against treatment 1 in T1
G2:T2 : treatment 2 effect in G2
G3:T2 : treatment 3 effect in G2
G2:T3 : treatment 2 effect in G3
G3:T3 : treatment 3 effect in G3
```

The model built with every parameter compared to the references. following the DESeq2 vignette I built the contrast test for example :

effect of the T2 compare to the T1 for G1 (treatment 2 effect on the genotype 1) :

```
results(deseq.object,contrast=list(c("T2vsT1")))
```

effect of the T2 for G2 compared to G1 (treatment 2 effect on the genotype 2):

```
results(deseq.object,contrast=list(c("T2vsT1","G2:T2")))
```

effect of the T2 for G2 against G3 (treatment 2 effect and genotype 2 vs genotype 3 effect = genotype environment interaction):

```
results(deseq.object,contrast=list(c("G2:T2","G3:T2")))
```

If I understood, for the last example, I tested the GxE effect in the treatment 2 corrected by the treatment 1 (the reference) and compared between 2 genotypes (typically as in a linear model in R).

After that, I have some contrast files, especially with log2foldchange but I didn't understand the underlying comparison. If I want to test the effect in a genotype of the treatment 2 against 1 it's the ratio between the two treatment (with the fact that there is some modifications by deseq with shrink etc. not simply the ratio but the idea is here). But the logfoldchange for my last example when I test GxE is not clear and Deseq2 help and forum did'nt gave me an information about. Is it a ration between genotype in the treatment 2 after correction for the treatment 1 ? a ratio of ratio ?

Hello ,

Thank you very much because I understood first I made a mistake because in my model I have interaction and I didn't use the shrinkage function with lfcShrink which seem to be necessary in my case to avoid expression level mistake.

0Hello,

Just thank you I discussed with a statistician collegue and I understand you answers !

So log2foldchange in interaction term for B against A in env 2 is:

Thank's !

Juste a question about coding interaction, in the

`results vignette`

It's exactely the same if I wrote with numeric vector with only +1 for

`genotypeIII.conditionB`

But you also said:

If you code that, you add the first parameter with the second like that:

But if I want the difference between III and II I believed to write:

I'm not sure of the last contrast test.

0When you provide a

`list`

to`contrast`

, the first element of the list gets the`+1`

and the second element of the list gets a`-1`

. You can have multiple elements in the first element and/or multiple in the second element, e.g.`list( c(...), c(...) )`

. Then the coefficients you name in the first`c(...)`

will get`+1`

and likewise the coefficients in the second`c(...)`

get`-1`

.25kHi,

I have been struggling for some time with the same problem, making a contrast between effects in two conditions with a code like the above, "results(dds, contrast=list("genotypeIII.conditionB", "genotypeII.conditionB")). Unfortunately, I'm not sure I understand the answer.

I would expect the code to test a subtraction of the two interactions, that is similar to results(dds, contrast=c(0,0,0,0,+1,-1). However, the executed code is an addition, identical to results(dds, contrast=c(0,0,0,0,+1,+1).

Is this really correct?, and in that case is there a way to specify contrast=c(0,0,0,0,+1,-1) using names?

10That's not correct. It performs an addition if you do

`list( c("x", "y") )`

, but not if you do`list("x", "y")`

.25kThank you very much for the quick reply.

You are absolutely right, I had overlooked the important difference between list( c("x", "y") ) and list("x", "y").

It all makes sense now.

10