Hi, I have a data table of gene expression which contains TPM value. So here I try to do a heatmap plot. So I scale by gene level at first and produce negative value. So why negative values comes up?
Hi, I have a data table of gene expression which contains TPM value. So here I try to do a heatmap plot. So I scale by gene level at first and produce negative value. So why negative values comes up?
OP mentioned in one of the comments that he is using rowScales functions for scaling and has not mentioned the package, while we guess it might be from scrime package.
The reason for getting negative values is because rowScales scales the row in a way such that the values in each row would have zero mean and a standard deviation of 1, thus producing negative values. As the scaling is being done to plot heatmap, the other way would be to perform log2(TPM) transformation and plot a heatmap and incase there are TPM values less than zero then log2(TPM+1) can be done as for the purpose of the heatmap, it won’t make much difference.
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
What kind of scaling have you done?
If it's
log scale
orzscore
there will be negative values for values less than 1Can you include your code here?
rowScales(data) - Very simple code.
That's not as simple as you claim - which package is
rowScales
from? Why are you using it instead ofscale
?Why don't you share us the
package
name used in R? Tell us about the functionrowScales