How to calculate LogFC? [gene expression matrix]?
2
0
Entering edit mode
2.2 years ago
ja4123 ▴ 20

Hi! I need to calculate LogFC for gene expression matrix (for two condition). First I calculated fold change:

FC = mean(experiment) / mean(control) 

Taking into consideration that I firstly standardized gene expression matrix, so I have mean values less than 0. So how can I calculate log2? To be sure, LogFC is calculated in this way:

log2FC = log2(experiment.mean()) - math.log2(control.mean())

I can not take log2 form number less than 0. Kindly help.

gene expression LogFC • 981 views
ADD COMMENT
1
Entering edit mode
2.2 years ago

As pointed out by ATpoint it is best to use a tool that can handle these cases.

But even those can run into trouble.

Usually what needs to be done is to remove data where there is reason to believe that the ratios do not make sense, for example dividing a tiny number with another tinier number can create huge fold changes that may not valid - perhaps both of those tiny numbers are random noise. So a minimal expression level should be needed before you proceed to compute a fold change.

You can also run into trouble when dividing with zero (or close to zero) (the control does not change).

filter out data that does not make sense, in some cases people choose to add 1 to both numerator and denominator as a correction but that too can lead to other problems. It is more of a correction against runaway division where at least one side has a valid count.

ADD COMMENT
0
Entering edit mode
2.2 years ago
ATpoint 82k

Is this RNA-seq? Load it into DESeq2 to get proper fold changes. Manual is over at Bioconductor. It is not the naive quotient of the counts or means.

ADD COMMENT

Login before adding your answer.

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