This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How Logfc Value Is Calculated In Edger?

Hi Fellows,

Any idea how logFC value is calculated in edgeR.

So that I can confirm what does "+" and "-" value means in term of up or down regulation.

Thanks in advance.

Naresh

edger r rna-seq

Hi zx8754,

Can you please elaborate your answer.

Naresh

Did you check the weblink? See post by Gordon Smyth.

I checked his post. But it does not say clearly how fold change was calculated.

1 answer

"So that I can confirm what does "+" and "-" value means in term of up or down regulation."

I would first say that up or down regulation is a mechanism, whereas your experiment is measuring an enrichment in one condition relative to another. No need to put forth a mechanism when you simple need to describe what you observe.

I get the sense you're more confused about numbers in log space than anything really having to do with edgeR. When you're comparing two things: A and B, the fold change is A/B. A and B could be data sets reflecting gene expression measured under different conditions. If gene1 is 2-fold higher in A, the A/B ratio for gene1 is 2. If gene47 is 2-fold higher in B than A, the gene47 ratio is 0.5. However, edgeR displays the log2 of the ratio. Therefore genes up or down by a given amount (i.e. two-fold) have the same distance from equality, but the sign (+/-) changes. Thus gene1 would have logFC: 1, and gene47 would have logFC: -1, reflecting 2-fold up or down respectively. In log2 space the numbers are close enough to how we think about fold change to develop an intuition. For instance: -2 is 4-fold down, -1 is 2-fold down, 0 is equal in A and B (a ratio of 1), 1 is 2-fold up, 2 is 4-fold up, etc. To convert the logFC value from edgeR (which are essentially ratios of the normalized count values per gene) into an up or down ratio, you simply take 2 to the power of the logFC number. e.g. for a gene with logFC of 0.5 or -0.5: the ratio is 2^0.5 = 1.4, or 2^-0.5 = 0.7, respectively.

Thank you so much for clarification.

One Quick question: In edgeR, when I type this cmd topTags(d2). I see below output.

#Comparision of group: WT-40
#GeneID    logFC     logCPM    PValue    FDR

Does this mean WT vs 40 and not other way around?

To cross check this, I shift 40 column counts in place of WT column counts in input file.

Then I run edgeR again.

#topTags(d2)
##Comparision of group: 40 - WT
This time value in logFC become positive(+) which were negative in above comparison.

Can you please guide me in correct direction.

I would really appreciate your help.

Thanks,
Naresh

If a logFC value for the WT-40 comparison is positive, then that gene is more highly expressed in the WT group (a negative value would mean the opposite). Swapping the groups, then, would swap all of the signs.

Thanks a lot dpryan79.

Appriciate your help.

When calculate the fold-change (FC), usually a value less than 1 is replaced by a negative inverse of the original FC. It's more intuitive and can be used for Volcano plot. Taking the above cases as examples,

A/B=2,     logFC=1,  FC=2^1=2
A/B=0.5,  logFC=-1, FC=-1/2^-1=-2

Log in to answer this question.