comparing contrasts in edger/lima using makeContrasts function
1
0
Entering edit mode
@ba0e3247
Last seen 14 months ago
United States

So basically I have two genotypes myt1l and wt, and I have two treatments dep and control. The question I want answered is what is the difference between myt1l_dep versus myt1l_control VERSUS wt_dep versus wt_control. Basically we think our genotype is having an impact on the ability of a mouse to respond to a treatment.

I have generated many versions of the contrast but am not sure which one is the best one to use. Here are my top 2 most logical contrasts that I have made so far.

#more information about my design
d$samples$group <- paste(d$samples$genotype, d$samples$treatment, d$samples$day, sep = "_")

design <- model.matrix(~0 + group + sex, d$samples)

#... running voom and whatnot ...

contrasts<- makeContrasts(md2_myt1l_dep_v_control_v_wt_dep_v_control = (groupmyt1l_dep_md2 - groupmyt1l_control_md2) +
                                                                        (groupwt_dep_md2 - groupwt_control_md2),

                                           md2_myt1l_dep_v_control_v_wt_dep_v_control = (groupmyt1l_dep_md2 - groupmyt1l_control_md2) -
                                                                        (groupwt_dep_md2 - groupwt_control_md2),

                          levels=colnames(coef(fit)))

contrasts

Contrasts
Levels                   md2_myt1l_dep_v_control_v_wt_dep_v_control md2_myt1l_dep_v_control_v_wt_dep_v_control
  groupmyt1l_control_md2                                         -1                                         -1
  groupmyt1l_control_md6                                          0                                          0
  groupmyt1l_dep_md2                                              1                                          1
  groupmyt1l_dep_md6                                              0                                          0
  groupwt_control_md2                                            -1                                          1
  groupwt_control_md6                                             0                                          0
  groupwt_dep_md2                                                 1                                         -1
  groupwt_dep_md6                                                 0                                          0
  sexm                                                            0                                          0


design
                                 groupmyt1l_control_md2 groupmyt1l_control_md6 groupmyt1l_dep_md2 groupmyt1l_dep_md6 groupwt_control_md2
sample.27247_3m_myt1lmd6_dep                          0                      0                  0                  1                   0
sample.27247_3m_myt1lmd6_control                      0                      1                  0                  0                   0
sample.27247_2m_wtmd6_dep                             0                      0                  0                  0                   0
sample.27247_2m_wtmd6_control                         0                      0                  0                  0                   0
sample.27247_1m_wtmd6_dep                             0                      0                  0                  0                   0
sample.27247_1m_wtmd6_control                         0                      0                  0                  0                   0
sample.27266_7f_wtmd6_dep                             0                      0                  0                  0                   0
sample.27266_7f_wtmd6_control                         0                      0                  0                  0                   0
sample.27266_5f_myt1lmd6_dep                          0                      0                  0                  1                   0
sample.27266_5f_myt1lmd6_control                      0                      1                  0                  0                   0
sample.27402_5f_myt1lmd6_dep                          0                      0                  0                  1                   0
sample.27402_5f_myt1lmd6_control                      0                      1                  0                  0                   0
sample.27402_3f_wtmd6_dep                             0                      0                  0                  0                   0
sample.27402_3f_wtmd6_control                         0                      0                  0                  0                   0
sample.27299_4m_wtmd6_dep                             0                      0                  0                  0                   0
sample.27299_4m_wtmd6_control                         0                      0                  0                  0                   0
sample.27299_3m_myt1lmd6_dep                          0                      0                  0                  1                   0
sample.27299_3m_myt1lmd6_control                      0                      1                  0                  0                   0
sample.27254_7f_myt1lmd6_dep                          0                      0                  0                  1                   0
sample.27254_7f_myt1lmd6_control                      0                      1                  0                  0                   0
sample.27254_2f_myt1lmd6_dep                          0                      0                  0                  1                   0
sample.27254_2f_myt1lmd6_control                      0                      1                  0                  0                   0
sample.27247_3f_myt1lmd2_dep                          0                      0                  1                  0                   0
sample.27247_3f_myt1lmd2_control                      1                      0                  0                  0                   0
sample.27247_1f_wtmd2_dep                             0                      0                  0                  0                   0
sample.27247_1f_wtmd2_control                         0                      0                  0                  0                   1
sample.27266_9f_wtmd2_dep                             0                      0                  0                  0                   0
sample.27266_9f_wtmd2_control                         0                      0                  0                  0                   1
sample.27266_8f_myt1lmd2_dep                          0                      0                  1                  0                   0
sample.27266_8f_myt1lmd2_control                      1                      0                  0                  0                   0
sample.27402_4m_myt1lmd2_dep                          0                      0                  1                  0                   0
sample.27402_4m_myt1lmd2_control                      1                      0                  0                  0                   0
sample.27402_2m_myt1lmd2_dep                          0                      0                  1                  0                   0
sample.27402_2m_myt1lmd2_control                      1                      0                  0                  0                   0
sample.27402_1m_wtmd2_dep                             0                      0                  0                  0                   0
sample.27402_1m_wtmd2_control                         0                      0                  0                  0                   1
sample.27299_2f_wtmd2_dep                             0                      0                  0                  0                   0
sample.27299_2f_wtmd2_control                         0                      0                  0                  0                   1
sample.27299_1f_wtmd2_dep                             0                      0                  0                  0                   0
sample.27299_1f_wtmd2_control                         0                      0                  0                  0                   1
sample.27299_5f_myt1lmd2_dep                          0                      0                  1                  0                   0
sample.27299_5f_myt1lmd2_control                      1                      0                  0                  0                   0
sample.27254_3m_myt1lmd2_dep                          0                      0                  1                  0                   0
sample.27254_3m_myt1lmd2_control                      1                      0                  0                  0                   0
sample.27254_5m_wtmd2_dep                             0                      0                  0                  0                   0
sample.27254_5m_wtmd2_control                         0                      0                  0                  0                   1
                                 groupwt_control_md6 groupwt_dep_md2 groupwt_dep_md6 sexm
sample.27247_3m_myt1lmd6_dep                       0               0               0    1
sample.27247_3m_myt1lmd6_control                   0               0               0    1
sample.27247_2m_wtmd6_dep                          0               0               1    1
sample.27247_2m_wtmd6_control                      1               0               0    1
sample.27247_1m_wtmd6_dep                          0               0               1    1
sample.27247_1m_wtmd6_control                      1               0               0    1
sample.27266_7f_wtmd6_dep                          0               0               1    0
sample.27266_7f_wtmd6_control                      1               0               0    0
sample.27266_5f_myt1lmd6_dep                       0               0               0    0
sample.27266_5f_myt1lmd6_control                   0               0               0    0
sample.27402_5f_myt1lmd6_dep                       0               0               0    0
sample.27402_5f_myt1lmd6_control                   0               0               0    0
sample.27402_3f_wtmd6_dep                          0               0               1    0
sample.27402_3f_wtmd6_control                      1               0               0    0
sample.27299_4m_wtmd6_dep                          0               0               1    1
sample.27299_4m_wtmd6_control                      1               0               0    1
sample.27299_3m_myt1lmd6_dep                       0               0               0    1
sample.27299_3m_myt1lmd6_control                   0               0               0    1
sample.27254_7f_myt1lmd6_dep                       0               0               0    0
sample.27254_7f_myt1lmd6_control                   0               0               0    0
sample.27254_2f_myt1lmd6_dep                       0               0               0    0
sample.27254_2f_myt1lmd6_control                   0               0               0    0
sample.27247_3f_myt1lmd2_dep                       0               0               0    0
sample.27247_3f_myt1lmd2_control                   0               0               0    0
sample.27247_1f_wtmd2_dep                          0               1               0    0
sample.27247_1f_wtmd2_control                      0               0               0    0
sample.27266_9f_wtmd2_dep                          0               1               0    0
sample.27266_9f_wtmd2_control                      0               0               0    0
sample.27266_8f_myt1lmd2_dep                       0               0               0    0
sample.27266_8f_myt1lmd2_control                   0               0               0    0
sample.27402_4m_myt1lmd2_dep                       0               0               0    1
sample.27402_4m_myt1lmd2_control                   0               0               0    1
sample.27402_2m_myt1lmd2_dep                       0               0               0    1
sample.27402_2m_myt1lmd2_control                   0               0               0    1
sample.27402_1m_wtmd2_dep                          0               1               0    1
sample.27402_1m_wtmd2_control                      0               0               0    1
sample.27299_2f_wtmd2_dep                          0               1               0    0
sample.27299_2f_wtmd2_control                      0               0               0    0
sample.27299_1f_wtmd2_dep                          0               1               0    0
sample.27299_1f_wtmd2_control                      0               0               0    0
sample.27299_5f_myt1lmd2_dep                       0               0               0    0
sample.27299_5f_myt1lmd2_control                   0               0               0    0
sample.27254_3m_myt1lmd2_dep                       0               0               0    1
sample.27254_3m_myt1lmd2_control                   0               0               0    1
sample.27254_5m_wtmd2_dep                          0               1               0    1
sample.27254_5m_wtmd2_control                      0               0               0    1
attr(,"assign")
[1] 1 1 1 1 1 1 1 1 2
attr(,"contrasts")
attr(,"contrasts")$group
[1] "contr.treatment"

attr(,"contrasts")$sex
[1] "contr.treatment"

When I use the plus sign, I get something that looks like a normal volcano plot but the logFC's are somewhat hard to interpret. When I use the minus sign all the p-values jump to 1 and the volcano plot looks like a line... Has anyone done this contrast before and knows what to do here? I have looked all over including in this guide: https://bioconductor.org/packages/release/workflows/vignettes/RNAseq123/inst/doc/designmatrices.html but have not found a concrete answer so far... Thanks!

DifferentialExpression edgeR limma • 783 views
ADD COMMENT
2
Entering edit mode
@james-w-macdonald-5106
Last seen 52 minutes ago
United States

It's the second one. The first one (if you divide by two to get the mean) is the main effect of treatment, which is the average difference between dep and control, regardless of the genotype. The second one is the interaction (or difference in differences if you are an Epidemiologist), where you are asking for those genes that react differently to treatment depending on the genotype.

The interaction term is generally less powerful than other direct comparisons, so it's not surprising that you get very few or no differences. You also need to divide by 2 for the main effect, or you are artificially inflating the coefficient by two, which will increase the number of significant p-values.

ADD COMMENT
1
Entering edit mode

Dividing the contrast by 2 only changes the estimated coefficients, it won't change the p-values.

ADD REPLY
0
Entering edit mode

Oh yes. Of course. Thanks for pointing that out!

ADD REPLY

Login before adding your answer.

Traffic: 912 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