Question: Scaling data using Pheatmap
0
gravatar for statfa
2.2 years ago by
statfa450
statfa450 wrote:

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?

pheatmap scale • 4.1k views
ADD COMMENTlink written 2.2 years ago by statfa450

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

ADD REPLYlink written 2.2 years ago by xieshaojun0621110

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 REPLYlink written 2.2 years ago by statfa450
1

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 REPLYlink modified 2.2 years ago • written 2.2 years ago by xieshaojun0621110

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 REPLYlink written 2.2 years ago by statfa450
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1134 users visited in the last hour