Scaling data using Pheatmap
1
0
Entering edit mode
7.1 years ago
statfa ▴ 760

Hi,

I'm going to draw a heatmap for DE analysis. According to my research, these are the steps:

1- I sorted genes by their FDR and chose 30 of the most significant genes.

2- I'm using the normalized read counts of the chosen genes to draw heatmaps.

3- When I'm going to scale my normalized read counts using package "Pheatmap", I choose "scale by row". (Rows are genes)

Now my problem is this package scales the data to mean 0 and standard deviation 3. While I'm gonna scale them to mean 0 and SD 1.

Would you please help me know what I can do? can "pheatmap" scale my data the way I want?

scale pheatmap • 15k views
ADD COMMENT
0
Entering edit mode
7.1 years ago

Why do you think pheatmap scales the data to mean 0 and standard deviation 3?

ADD COMMENT
0
Entering edit mode

My colors change from -3 to 3 And 0 is in the middle of them. And I used pheatmap on two data sets and both were scaled the same.

ADD REPLY
4
Entering edit mode

Here is the functions in the code :

scale_rows = function(x){
    m = apply(x, 1, mean, na.rm = T)
    s = apply(x, 1, sd, na.rm = T)
    return((x - m) / s)
}

As you can see, scale in this package means removing the mean (centering) and dividing by the standard deviation (scaling). This is actually Z-score value. For Z-score values, 3 means 3 SDs away from the center (0). Hope this can help you.

ADD REPLY
0
Entering edit mode

Yeah,thank you. I had read it but I thought that maybe after scaling, my data should follow standard normal distribution. But if you say my scaling is fine, then that's ok.

ADD REPLY

Login before adding your answer.

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