EdgeR Paired-Sample Test
1
1
Entering edit mode
6.5 years ago
maggiepan • 0

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

edgeR RNA-Seq • 5.1k views
ADD COMMENT
3
Entering edit mode
6.5 years ago

Please see section 3.4.2 of the edgeR vignette.

result_glm <- glmQLFTest(fit, coef=5)  # Or maybe coef=4, it'll be the last column in "design"
ADD COMMENT
0
Entering edit mode

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!

ADD REPLY
1
Entering edit mode

Correct, it'd be coef=3 in that case.

ADD REPLY
0
Entering edit mode

Thank you!!!!

ADD REPLY

Login before adding your answer.

Traffic: 1680 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6