How should I construct this contrast?
1
0
Entering edit mode
8.8 years ago
carl.h ▴ 20

I want to study the effect of TGF-beta between two genotypes WT and KO. To compare the two genotypes, we have knocked out (KO) the gene using the parental as WT control. Then we have stimulated the cells with TGF-beta at 1 hour and 24 hours.

I created a design matrix for comparing the groups that looks like this:

   my.design <- model.matrix(~ 0  + design, data=matrix)

        KO1hControl KO1hTGF KO24hControl KO24hTGF WT1hControl WT1hTGF WT24hControl WT24hTGF
1                  0             0                  0              0                 0             1                  0              0
2                  0             0                  0              0                 0             0                  0              1
3                  0             0                  0              0                 1             0                  0              0
4                  0             0                  0              0                 0             0                  1              0
5                  0             1                  0              0                 0             0                  0              0
6                  0             0                  0              1                 0             0                  0              0
7                  1             0                  0              0                 0             0                  0              0
8                  0             0                  1              0                 0             0                  0              0
9                  0             0                  0              0                 0             1                  0              0
10                 0             0                  0              0                 0             0                  0              1
11                 0             0                  0              0                 1             0                  0              0
12                 0             0                  0              0                 0             0                  1              0
13                 0             1                  0              0                 0             0                  0              0
14                 0             0                  0              1                 0             0                  0              0
15                 1             0                  0              0                 0             0                  0              0
16                 0             0                  1              0                 0             0                  0              0
17                 0             0                  0              0                 0             1                  0              0
18                 0             0                  0              0                 0             0                  0              1
19                 0             0                  0              0                 1             0                  0              0
20                 0             0                  0              0                 0             0                  1              0
21                 0             1                  0              0                 0             0                  0              0
22                 0             0                  0              1                 0             0                  0              0
23                 1             0                  0              0                 0             0                  0              0
24                 0             0                  1              0                 0             0                  0              0
25                 0             0                  0              0                 0             1                  0              0
26                 0             0                  0              0                 0             0                  0              1
27                 0             0                  0              0                 1             0                  0              0
28                 0             0                  0              0                 0             0                  1              0
29                 0             1                  0              0                 0             0                  0              0
30                 0             0                  0              1                 0             0                  0              0
31                 1             0                  0              0                 0             0                  0              0
32                 0             0                  1              0                 0             0                  0              0

I have compared the samples to see the effect of TGF-beta stimulation: WT1hTGF - WT1hControl, KO1hTGF - KO1hControl .. And so on. Now I would like to compare the samples which genes differ between WT and KO when stimulated with TGF-beta.

Does anyone have a suggestion how such a matrix would look like?

RNA-Seq edgeR • 1.8k views
ADD COMMENT
0
Entering edit mode
8.8 years ago
mforde84 ★ 1.4k

Sure, actually had the same problem recently and got a good answer off bioconducters support forum:

library(limma)
# say i have a data for three groups each with 10 samples, where columns are sample name
nGrp1 <- 10
nGrp2 <- 10
nGrp3 <- 10
# i make a factor for the groups
groups <- factor(rep(1:3, c(nGrp1, nGrp2, nGrp3))
# this generates the contrasts for the main effect of groups
design <- model.matrix(~0 + groups)
# this generates the group level contasts
contrasts <- makeContrasts(groups1 - groups2, group1 - group3, group2 - group3, levels=design)
# fit linear model to data set using the design variable
fit <- lmFit(x, groups)
fit < eBayes(fit)
# fit model for to results using post-hoc contrasts
fit2 <- contrasts.fit(fit, contrasts)
fit2 <- eBayes(fit2)

You'll have to modify it for your application, but this should give you a good idea of how to set up the contrasts.

ADD COMMENT
0
Entering edit mode

I am sorry, but I am still not sure how I would construct the contrast. For example If I would like to show which genes are up regulated in KOTGF treated compared to WTTGF.

ADD REPLY

Login before adding your answer.

Traffic: 5630 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6