Hi guys,
Recently, a colleague of mine used the Trinity Assembly pipeline to produce a heat map, using a table of the expression levels of many genes for a few samples as the raw input data.
The output was actually a heat map of the logs of the expression levels.
Since some of the expression levels were 0, the logs of these entries would be negative infinity.
When using the heatmap.2() function in R to draw the heat map, an error was returned saying that NA/NaN/inf values were not acceptable.
So I'm just curious: how does the program in Trinity Assembly deal with log(0) entries?
I have asked my colleague, and he does not know either.
Thank you for your replies in advance!
Don't know about Trinity, but a popular way to address log(x) with x >= 0 is to add a small number to x so that log(0) never happens. Adding +1 has the nice feature that log(x+1) = 0 if x=0. The underlying assumption is that the increment (e.g. +1) doesn't skew the data too much, i.e. most of the non-zero values are >>0.