Hello,
I am trying to do edgeR analysis, such as described in 3.5 of the manual. My experiment is very alike, but I don't exactly understand how to get all the contrasts of my interests. Here some code:
> data.frame(Genotype, Cell, Patient) Genotype Cell Patient 1 WT TCM 1 2 WT TEM 1 3 WT TRM 1 4 WT TCM 2 5 WT TEM 2 6 WT TRM 2 7 WT TCM 3 8 WT TEM 3 9 WT TRM 3 10 MUT TCM 1 11 MUT TEM 1 12 MUT TRM 1 13 MUT TCM 2 14 MUT TEM 2 15 MUT TRM 2 16 MUT TCM 3 17 MUT TEM 3 18 MUT TRM 3 > design <- model.matrix(~Genotype+Genotype:Cell+Genotype:Patient) > colnames(design) [1] "(Intercept)" "GenotypeMUT" "GenotypeWT:CellTEM" [4] "GenotypeMUT:CellTEM" "GenotypeWT:CellTRM" "GenotypeMUT:CellTRM" [7] "GenotypeWT:Patient" "GenotypeMUT:Patient"
Now to get some genes of interest:
# Genes respond different between TEM vs TCM in WT lrt <- glmLRT(fit, coef="GenotypeWT:CellTEM") topTags(lrt) # Genes respond different between TEM vs TCM in MUT lrt <- glmLRT(fit, coef="GenotypeMUT:CellTEM") topTags(lrt)
# Genes respond different between TRM vs TCM in MUT lrt <- glmLRT(fit, coef="GenotypeMUT:CellTRM") topTags(lrt) # Genes respond different between TRM in MUT vs TRM in WT lrt <- glmLRT(fit, contrast=c(0,0,0,0,-1,1,0,0)) topTags(lrt)
I hope I understood this correctly.
First Question: Is it possible with this design to get genes that respond different between TRM vs TEM in MUT? Or do I have to make another design first for this specific contrast?
Second question: Is it possible to get genes that respond different between TCM in MUT vs TCM in WT?
Thanks for your explanation. So for the last part, which is only possible as indirect comparison (MUT.TEM vs WT.TEM). What will be the meaning of the fold changes in the topTags results? So I understand that the patient blocking does not make sense for such comparison (since WT patient 1 is not the same as MUT patient 1). Alternatively, do you think I can safely make a new design without patient blocking for this comparison? I don't wanna go to limma, since this is count data from ATAC-seq and not 'normal' RNAseq.
I assume you're referring to
MUT.TEM
vsWT.TEM
. The log-fold changes for an indirect comparison will be the TEM/TCM log-fold change in mutant, minus the TEM/TCM log-fold change in the wild-types.If you want to compare TCM in MUT against TCM in WT, I would suggest performing an edgeR analysis with only the TCM samples, using a single factor for the genotype. This avoids any problems due to unmodelled correlations between samples from the same patient, as each patient now only contributes one sample to the data subset.
However, if you want to analyze all cell types together, it is unlikely that you can avoid blocking on
patient
. Individual-specific effects are particularly prominent in human patient data, you will have to deal with it somehow.