Scaled gene expression data and produced negative value
1
1
Entering edit mode
3.9 years ago
Nan ▴ 10

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?

RNA-Seq gene R • 8.3k views
ADD COMMENT
3
Entering edit mode

What kind of scaling have you done?

If it's log scale or zscore there will be negative values for values less than 1

ADD REPLY
0
Entering edit mode

Can you include your code here?

ADD REPLY
0
Entering edit mode

rowScales(data) - Very simple code.

ADD REPLY
1
Entering edit mode

That's not as simple as you claim - which package is rowScales from? Why are you using it instead of scale?

ADD REPLY
1
Entering edit mode

Why don't you share us the package name used in R? Tell us about the function rowScales

ADD REPLY
2
Entering edit mode
3.8 years ago
Elucidata ▴ 270

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.

ADD COMMENT
0
Entering edit mode

I think you mean rowScales instead of rowSums function.

ADD REPLY
0
Entering edit mode

Thanks for pointing it out. Have made the modifications.

ADD REPLY

Login before adding your answer.

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