Question: Mixed conditions: Design and contrast matrix
0
Patrick0 wrote:

Hello,

I performed a RNAseq experiment from microbial cultivations in order to investigate carbon catabolite repression.

I used 2 different strains: A and B

in 2 different media conditions and in a Mix of these conditions: x, y and xy

Experiments were performed in triplicates. Here is the experimental setup:

strain condition

[1,] "A"    "x"
[2,] "A"    "x"
[3,] "A"    "x"
[4,] "A"    "y"
[5,] "A"    "y"
[6,] "A"    "y"
[7,] "A"    "xy"
[8,] "A"    "xy"
[9,] "A"    "xy"
[10,] "B"    "x"
[11,] "B"    "x"
[12,] "B"    "x"
[13,] "B"    "y"
[14,] "B"    "y"
[15,] "B"    "y"
[16,] "B"    "xy"
[17,] "B"    "xy"
[18,] "B"    "xy"

Now iam trying to setup a model matrix.

Since I dont know if the media conditions have the same effect on the two strains, I want to include an interaction term strain:condition.

Now Iam not sure how to set a proper model which also takes the "Mixed" property of "xy" into account.

Should i treat it like a third condition (like "z") ?

If I would only have condition "x" and "y", I would set up the modelmatrix like this:

strain <- factor(c("A", "A", "A", "A", "A", "A", "B", "B", "B", "B", "B", "B"))

condition <- factor(c("x", "x", "x", "y", "y", "y", "x", "x", "x", "y", "y", "y"))

design <- model.matrix( ~ strain + condition + strain:condition)

> design

(Intercept) strainB conditiony strainB:conditiony
1            1       0          0                  0
2            1       0          0                  0
3            1       0          0                  0
4            1       0          1                  0
5            1       0          1                  0
6            1       0          1                  0
7            1       1          0                  0
8            1       1          0                  0
9            1       1          0                  0
10           1       1          1                  1
11           1       1          1                  1
12           1       1          1                  1
attr(,"assign")
 0 1 2 3
attr(,"contrasts")
attr(,"contrasts")$strain  "contr.treatment" attr(,"contrasts")$condition
 "contr.treatment"

If you have any suggestions I would be very happy.

Best

Answer: Mixed conditions: Design and contrast matrix
1
Ryan C. Thompson7.4k wrote:

If you believe that the effects of the two conditions x and y should be independent and additive, then you would want to model them separately by splitting the condition factor into an x factor and a y factor. However, the more likely scenario is that the effect of the xy condition is not simply the sum of x and y. So it's probably best to simply model condition as a factor with 3 levels: x, y, and xy.

Now, since you want an interaction between strain and condition, and you likely want to test a number of different interaction coefficients, you might as well combine the two into a single factor with 6 levels, and use the no-intercept design to get a coefficient for each group mean:

group <- interaction(strain, condition, sep=".")
design <- model.matrix(~0 + group)

Then use makeContrasts to define the tests you want to perform in terms of the group means.

ADD COMMENTlink modified 23 months ago • written 23 months ago by Ryan C. Thompson7.4k
Answer: Mixed conditions: Design and contrast matrix
0
Patrick0 wrote:

Sorry for the weird code formatting. But I get an error message all the time..