Hi,
I am using edgeR to carry out DE analysis for my RNA Seq samples, may I know how can I construct the design matrix and how can I make sure that during testing, the DE genes shown are of the correct contrast?
My current steps are shown below:
Current data type: subject: 1,2,3,4
treatment for each subject: T0, T1
I would like to find DE genes between conditions (T0, T1) for each paired samples:
design <- model.matrix(~Subject+Condition)
d <- d[rowSums(cpm(d)>10) >= (length(G1_ids)/2),,keep.lib.sizes = FALSE ]
d <- calcNormFactors(d)
d <- estimateGLMCommonDisp(d,design)
d <- estimateGLMTrendedDisp(d,design)
d <- estimateGLMTagwiseDisp(d,design)
fit <- glmQLFit(d, design, robust = TRUE)
result_glm <- glmQLFTest(fit)
It seems to me that, using the above steps, I get DE genes which are differentially expressed between samples, not between conditions.
Thank you! Maggie Pan
May I know if this would be correct to find the difference in each paired samples if there are two paired samples:
design (Intercept) SubjectA ConditionTreatment
1 1 0 0
2 1 0 1
3 1 1 0
4 1 1 1
I used coef = 3 in this case. Thanks!
Correct, it'd be
coef=3
in that case.Thank you!!!!