Hello,

I have an RNA-seq experiment that I would like to analysis using nested design matrix, similar to section 3.5 in the edgeR User's Guide:

`> design <- model.matrix(~Disease+Disease:Patient+Disease:Treatment)`

> colnames(design)

[1] "(Intercept)" "DiseaseDisease1"

[3] "DiseaseDisease2" "DiseaseHealthy:Patient2"

[5] "DiseaseDisease1:Patient2" "DiseaseDisease2:Patient2"

[7] "DiseaseHealthy:Patient3" "DiseaseDisease1:Patient3"

[9] "DiseaseDisease2:Patient3" "DiseaseHealthy:TreatmentHormone"

[11] "DiseaseDisease1:TreatmentHormone" "DiseaseDisease2:TreatmentHormone"

My goal is to find genes that respond differently to the hormone in ANY disease pairs (disease1 vs healthy, disease2 vs healthy, and disease1 vs disease2). Although I could achieve each comparison using contrasts, as stated on page 39 of the User's Guide,

`qlf`

` <- glmQLFTest(fit, contrast=c(0,0,0,0,0,0,0,0,0,-1,1,0))`

`qlf`

` <- glmQLFTest(fit, contrast=c(0,0,0,0,0,0,0,0,0,-1,0,1))`

`qlf`

` <- glmQLFTest(fit, contrast=c(0,0,0,0,0,0,0,0,0,0,-1,1))`

I was wondering if I could combine the above three into one glmQLFTest using either contrast or coefficient. In my data, I have 18 genotypes comparable to the disease group in the above example and I am interested in finding the genes respond differently to the treatment in ANY genotype comparison. This would result in 153 possible pair-wise comparisons and I'm curious to know a way better than conducting glmQLFTest 153 times.

`>mydesign <- model.matrix(~genotype+genotype:treatment)`

>colnames(mydesign)

[1] "(Intercept)" "genotype2" "genotype3" "genotype4"

[5] "genotype5" "genotype6" "genotype7" "genotype8"

[9] "genotype9" "genotype10" "genotype11" "genotype12"

[13] "genotype13" "genotype14" "genotype15" "genotype16"

[17] "genotype17" "genotype18" "genotype1:treatmentH" "genotype2:treatmentH"

[21] "genotype3:treatmentH" "genotype4:treatmentH" "genotype5:treatmentH" "genotype6:treatmentH"

[25] "genotype7:treatmentH" "genotype8:treatmentH" "genotype9:treatmentH" "genotype10:treatmentH"

[29] "genotype11:treatmentH" "genotype12:treatmentH" "genotype13:treatmentH" "genotype14:treatmentH"

[33] "genotype15:treatmentH" "genotype16:treatmentH" "genotype17:treatmentH" "genotype18:treatmentH"

Any help would be much appreciated!

Aaron,

Thank you so much for the detailed clarification. This certainly helped me better understand the contrast and ANODEV. I really appreciate it!