[BioC] Complex contrasts for between and within subject comparisons

Gordon K Smyth smyth at wehi.EDU.AU
Fri Jul 18 02:37:55 CEST 2014


Dear Tobias,

Multi-level experiments (with comparisons both between and within 
subjects) are quite complex to analyse.

edgeR can fit arbitrary linear models, but it cannot estimate multiple 
levels of variation.  For an experiment such as yours, edgeR can test for 
effects within subjects, and it can test for interactions between subject 
groups for these effects.  It cannot however test for marginal differences 
between the patient groups, because doing so would require estimating the 
variability of the patients as well as estimating variability of 
expression values within each patient.

For your experiment, you ask how to test for DE genes between resistant 
and sensitive cells in the control.  The short answer is that you can't 
using edgeR.  (Nor with other negative binomial based packages.)

I would suggest instead that you switch to limma-voom.  This will allow 
you to estimate the intra-patient correlation (using duplicateCorrelation) 
instead of including subject in the design matrix.  You will then be able 
to test any comparisons you wish between resistance and treatment groups.

The limma-voom approach to experiments such as yours has been discussed at 
some length on this mailing list, see for example:

https://stat.ethz.ch/pipermail/bioconductor/2014-May/059713.html

and the subsequent links.

Best wishes
Gordon


On Fri Jul 11 16:40:57 CEST 2014, Tobias Neumann [guest] guest at 
bioconductor.org wrote

> I have a question regarding the presented comparison both between and within 
> subjects in chapter 3.5 of the edgeR users guide:
>
> I have two sets of samples, one set being sensitive to a compound treatment, 
> the other resistant. For each group I have patient samples that were left 
> untreated, treated 2h with a compound and 24h with a compound, so patient is 
> clearly a blocking factor. This gives me the following design:
>
> design = model.matrix(~resist+resist:sub+resist:treat)
>
> 	   (Intercept) resistY resistN:sub2 resistY:sub2 resistN:sub3 
> resistY:sub3
> 1            1       0            0            0            0            0
> 2            1       0            0            0            0            0
> 3            1       0            0            0            0            0
> 4            1       0            1            0            0            0
> 5            1       0            1            0            0            0
> 6            1       0            1            0            0            0
> 7            1       0            0            0            1            0
> 8            1       0            0            0            1            0
> 9            1       0            0            0            1            0
> 10           1       1            0            0            0            0
> 11           1       1            0            0            0            0
> 12           1       1            0            0            0            0
> 13           1       1            0            1            0            0
> 14           1       1            0            1            0            0
> 15           1       1            0            1            0            0
> 16           1       1            0            0            0            1
> 17           1       1            0            0            0            1
> 18           1       1            0            0            0            1
>   resistN:treat24h resistY:treat24h resistN:treat2h resistY:treat2h
> 1                 0                0               0               0
> 2                 0                0               1               0
> 3                 1                0               0               0
> 4                 0                0               0               0
> 5                 0                0               1               0
> 6                 1                0               0               0
> 7                 0                0               0               0
> 8                 0                0               1               0
> 9                 1                0               0               0
> 10                0                0               0               0
> 11                0                0               0               1
> 12                0                1               0               0
> 13                0                0               0               0
> 14                0                0               0               1
> 15                0                1               0               0
> 16                0                0               0               0
> 17                0                0               0               1
> 18                0                1               0               0
>
> Now I understand that with the contrasts c(0,0,0,0,0,0,0,0,-1,1) and 
> c(0,0,0,0,0,0,-1,1,0,0) you can test for differentially expressed genes 
> between resistant and sensitive cells after 2h and 24h treatment, 
> respectively.
>
> What is unclear to me is for example how to test for differentially expressed 
> genes between resistant and sensitive cells in the control?
>
> It can't be c(0,1,0,0,0,0,0,0,0,0), since that would give me 
> differentially expressed genes between resistant and sensitive cells in 
> any state right?
>
> The only workaround I have come up so far is to relevel the treatment factors 
> and take treat2h as base level in order to be able to have now the control in 
> the contrast in its position.
>
> What is the proper way to do this?
>
> -- output of sessionInfo():
>
> Not needed since conceptual question
>
> --
> Sent via the guest posting facility at bioconductor.org.

______________________________________________________________________
The information in this email is confidential and intend...{{dropped:4}}



More information about the Bioconductor mailing list