RNA-seq z-score normalization
1
1
Entering edit mode
2.6 years ago
margott.j ▴ 10

Hi!

I have RNA-seq data that I have put into DeSeq2 (R) for analysis and I would like to create heatmaps. I have also run my data using the gsea software from the broad institute and I would like to replicate the heatmaps that come out of that in R. I assume that what the software does, is normalise the data using Z score. I have already log2 transformed the data using two methods:

  1. vst transformation
  2. a simple equation as seen in a previous post ( tdata <- log2(counts + 1))

There are previous forums on Z score normalisation, but they don't explain how to actually do this in R. Would anyone know the code for performing this normalisation?

Thank you in advance!

normalisation DESEq2 RNA-seq z-score • 4.9k views
ADD COMMENT
1
Entering edit mode

There is a base R function for this: scale(). Just keep in mind that it scales columns so you may have to feed your transposed matrix (t(matrix)).

ADD REPLY
0
Entering edit mode

thank you!

ADD REPLY
0
Entering edit mode

Hello there,

maybe you can have a look at this site : https://www.r-bloggers.com/2020/02/how-to-compute-the-z-score-with-r/

ADD REPLY
0
Entering edit mode

thank you !

ADD REPLY
3
Entering edit mode
2.6 years ago

Hi!

I suggest you to get the normalized counts from DESeq using the counts() function and setting TRUE the normalized = option. Then, filter your matrix of normalized counts selecting those genes associated with the gene set/pathway of interest. Finally, use the pheatmap package in order to plot your heatmaps. Take a look at the argument scale = within the pheatmap() function in order to scale your matrix respect to columns or rows and calculate z scores. Have a look at this r documentation site.

Best regards!

ADD COMMENT
0
Entering edit mode

thank you! I see that the scale = function with pheatmap allows the scaling according to rows/columns, in my case this would be columns. But how do I get the calculated z score? sorry this is unclear from the link you sent me!

ADD REPLY
0
Entering edit mode

It's alright!

For retrieving your calculated z-scores (by column) you should apply the scale() function on your matrix of normalized counts as @Papyrus suggest you. I understand that you want to retrieve the scaled matrix, am I right?

ADD REPLY

Login before adding your answer.

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