Hi all,
I have 18 samples, 3 tumor and 3 paired normal tissue samples, belonging to the same individual, at three different conditions, each in three replicates.
$df
sample group tissue
sample1-T-cond1 cond1 T
sample1-T-cond1 cond1 T
sample1-T-cond1 cond1 T
sample1-T-cond2 cond2 T
sample1-T-cond2 cond2 T
sample1-T-cond2 cond2 T
sample1-T-cond3 cond3 T
sample1-T-cond3 cond3 T
sample1-T-cond3 cond3 T
sample1-N-cond1 cond1 N
sample1-N-cond1 cond1 N
sample1-N-cond1 cond1 N
sample1-N-cond2 cond2 N
sample1-N-cond2 cond2 N
sample1-N-cond2 cond2 N
sample1-N-cond3 cond3 N
sample1-N-cond3 cond3 N
sample1-N-cond3 cond3 N
My goal is to compare T versus N (tissue), in each condition (group). In other words, I would like to get the list of DE genes in tumor samples, and I'd like to know if this list is the same in the three different conditions. I can't figure out how to manage the replicates and how to set the DGEList object and design matrix:
geneList = DGEList(counts=round(geneData), genes=rownames(geneData), group = df$group)
design = model.matrix(~df$group+df$tissue)
Is this solution right?
Thanks
It might be worth mentioning that the design matrix shown in the question also is correct but it's a bit harder to think about which coefficient to look at for which comparison of interest.
Yes, the original design matrix is valid but assumes that the effects of
group
andtissue
are additive. My design sacrifices some residual d.f. to eliminate this assumption, which is important if the tumor/normal difference is condition-specific (i.e., there is a non-zero interaction betweengroup
andtissue
). In contrast, the original design assumes that the tumor-normal difference is the same for all conditions.Thank you @Aaron Lun.
I made two more comparisons, namely conditions 2 and 3 versus the cond1:
So, when I use
geneQLFT = glmQLFTest(geneQLF, contrast=con)
, I get the followingAccordingly, I can assess that 13657 genes are DE across all paired-samples. This means that different conditions impact differently the results, but what is the best one?