This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Calculation of Fold change for already log transformed gene expression data

Hello all,

I have gene expression data for two groups of normal and disease that already log2 transformed.

The number of samples for normal groups is 134, and for disease group is 139. I selected one gene, and I want to do the Fold Change for these two groups (you can download my data from this link). I use the following code, and I would like to know whether I am doing something wrong or not.

FC = foldchange(mean(disease),mean(normal))

The result of the above code is 1.019742. Then I consider because my data is already log2 transformed, the FC>1 means upregulated and FC<-1 means downregulated. In this case, because FC= 1.019742 I consider this specific gene is upregulated.

I would be really grateful if you could let me know if I am doing something wrong.

Thanks

rna-seq r gene

Are you should you want the foldchange, and not the logFoldChange?

2 answers

When working in Log space, the logFoldChange is mean(b) - mean (a)

If you want the fold change, rather than the log fold change, I would calcluate the logFoldChange, and then convert that back into linear space:

2**(mean(b)-mean(a))

Thank you so much.

So based on what you mentioned, for my data mean(normal) = 10.11111931, and mean(disease) = 10.31073544

logFoldChange = 10.31073544 - 10.11111931 = 0.199616121

Now how can I know this gene is upregulated or downregulated?

Thanks

Hi,

You are doing something wrong indeed. The mean of log is not the same of log of mean. I suggest you go back to natural values and start over from that:

FC = (mean(2**disease)/mean(2**(normal))
log2FC = log2(FC)

The mean of the log is the geometric, rather than arithmetic mean. I think most common gene expression analysis packages use the geometric, rather than the arithmetic mean.

Log in to answer this question.