Question: EdgeR Paired-Sample Test
1
gravatar for maggiepan
2.6 years ago by
maggiepan0
maggiepan0 wrote:

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

rna-seq edger • 2.5k views
ADD COMMENTlink modified 2.6 years ago by Devon Ryan95k • written 2.6 years ago by maggiepan0
3
gravatar for Devon Ryan
2.6 years ago by
Devon Ryan95k
Freiburg, Germany
Devon Ryan95k wrote:

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 COMMENTlink written 2.6 years ago by Devon Ryan95k

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 REPLYlink modified 2.6 years ago • written 2.6 years ago by maggiepan0
1

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

ADD REPLYlink written 2.6 years ago by Devon Ryan95k

Thank you!!!!

ADD REPLYlink written 2.6 years ago by maggiepan0
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 2187 users visited in the last hour