Question: edgeR direction of expression and sign of Log Fold Changes
0
gravatar for ilyco
3.0 years ago by
ilyco50
United Kingdom
ilyco50 wrote:

Hi,

I used edgeR for differential expression analysis with 5 conditions relative to the baseline condition.

The design was a simple linear model with the condition factor variable re-ordered so that the baseline is the first value. The code was the following:

design <- model.matrix(~ condition, data = y$samples)
y <- estimateDisp(y, design, robust=TRUE) 
fit <- glmFit(y,design)
conditionA_minus_base <- glmTreat(fit, coef = "conditionA", lfc = minlfc) ### coefficient corresponds to A - baseline
up_A <- rownames(y)[decideTestsDGE(conditionA_minus_base, p.value = pvalue, adj = "fdr") == 1]
down_A <- rownames(y)[decideTestsDGE(conditionA_minus_base, p.value = pvalue, adj = "fdr") == -1]

However, when I checked the genes down-regulated, they are enriched for many terms which are known to be up-regulated. All in all, directions seems reversed for a large majority of genes. I checked labeling and pre-processing steps many times. Could you please let me know if the 1 and -1 values should be the other way around?

I tested two designs against each other:

design1 <- model.matrix(~ condition, data = y$samples)
design2 <- model.matrix(~ 0 + condition, data = y$samples)

Results are the same from:

 conditionA_minus_base1 <- glmTreat(fit, coef = "conditionA", lfc = minlfc) ### coefficient corresponds to A - baseline
 conditionA_minus_base2 <- glmTreat(fit, contrast = c(-1,1,0,0,0,0), lfc = minlfc)

where contrast = c(-1,1,0,0,0,0) coresponds to -1Baseline + 1 Condition A

Thank you.

lfc edger rna-seq R • 1.4k views
ADD COMMENTlink modified 2.9 years ago by Gordon Smyth780 • written 3.0 years ago by ilyco50

As long as the ordering is correct then what you're doing should work. The most common mistake here is when making the condition column in y$samples. Triple check that nothing is swapped there (hint: if you aren't already, load this from a text file).

ADD REPLYlink written 3.0 years ago by Devon Ryan90k
0
gravatar for Gordon Smyth
2.9 years ago by
Gordon Smyth780
Australia
Gordon Smyth780 wrote:

You code looks correct. Your up_A does contain genes up-regulated in condition A vs whatever you set for the reference level of 'condition', and down_A does correspond to down-regulated in condition A.

ADD COMMENTlink written 2.9 years ago by Gordon Smyth780
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: 801 users visited in the last hour