How to convert log2FC (Fold Change) obtained by differential expression analysis by DESeq2 to FC
1
0
Entering edit mode
5.7 years ago
sole.r.v • 0

Hi everyone,

I made a differential expression analysis of microRNAs with DESeq2. I got the logFC values that are log2(FC). How do I convert the values (positive and negative) to normal fold changes?

use 2^log2(FC)???

Thanks

DESeq2 log2FC Differential expression • 6.9k views
ADD COMMENT
3
Entering edit mode
5.7 years ago
ZheFrench ▴ 590

Function I use, where base = 2

  def logratio2foldchange (logratio, base) :

    retval = base^(logratio)
    if retval < 1 :
        return -1/retval
    else :
        return  retval
ADD COMMENT
3
Entering edit mode

Yes, was just generating an answer myself. That function should work for Python.

Here is another way in R Programming Language, and some proof:

log2fcs <- c(2, -2, 4, -4)
ifelse(log2fcs > 0, 2 ^ log2fcs, -1 / (2 ^ log2fcs))
[1]   4  -4  16 -16

If you want to ignore negative values in the linear fold change altogether, and are happy with fractions, then use:

ifelse(log2fcs > 0, 2 ^ log2fcs, 1 / (2 ^ abs(log2fcs)))
[1]  4.0000  0.2500 16.0000  0.0625

log2(0.0625)
[1] -4

log2(0.25)
[1] -2
ADD REPLY
0
Entering edit mode

Hi ZheFrench,

Is there a reference I can get for this or is that a nonsensical question?

ADD REPLY
0
Entering edit mode

This is just a 100% mathematical proof. You don't need a reference.

ADD REPLY

Login before adding your answer.

Traffic: 1112 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