Question: Heatmap of methylation beta values scale='rows' seems off
0
gravatar for Pin.Bioinf
8 weeks ago by
Pin.Bioinf230
Malaga
Pin.Bioinf230 wrote:

Hello,

I have plotted my methylation beta-values of 1000 CpGs in tumor-controls. The heatmap seems ok at first glance, but I see that some CpGs that are differentially hypomethylated in controls appear as hypermethylated in controls in the heatmap. Is this because of the z-score scaling? Should I convert to M values first? Thank you.

EDIT: Here is some code:

Matrix (only an example of the big matrix):

            SAmple1C  Sample2T  Sample3C   Sample4T  Sample5C   Sample6T
cg03185752   0.03128   0.06667   0.00079   0.13409    0.01614    0.00000
cg26222311   0.10023   0.00000   0.08416   0.00000    0.04864    0.00000
cg13488570   0.30099   0.06393   0.29301   0.02862    0.39648    0.00343

Code:

heatmap.2(Matrix,scale='row',col=bluered(149),trace='none',
main = "Centered CpG sites",ColSideColors=rep(c(col1[1],col1[4]),19),margins = c(9, 22),density.inf="none",symkey=TRUE)

legend("topright", title = "Samples",legend=c("Control","Tumor"), 
       fill=c(col1[1],col1[4]), cex=0.8, box.lty=0)

Result:

Heatmap

ADD COMMENTlink modified 8 weeks ago • written 8 weeks ago by Pin.Bioinf230

Share some code, so we can see what you're doing.

ADD REPLYlink written 8 weeks ago by b.nota6.1k

I just edited thanks.

ADD REPLYlink written 8 weeks ago by Pin.Bioinf230

The heatmap.2 function uses scale = "none" as default. If you find hypermethylated values, as hypo in your heatmap, you probably made a error before the z-score conversion. Maybe switched control with treatment group somewhere?

ADD REPLYlink modified 8 weeks ago • written 8 weeks ago by b.nota6.1k

What I expect to see is all hypomethylated tumors, no hypermethylated tumors, which makes sense in most of the heatmap, but at the bottom there is an inverse behaviour : hypermethylated tumors and hypomethylated controls. the DMPs calculation results in those CpGs show hypomethylation in tumor, so the heatmap should reflect the same thing in those cpgs right? or are z scores messing with it?

ADD REPLYlink written 8 weeks ago by Pin.Bioinf230

I don't see any code making z-scores, so I cannot judge if they are messing with it or not...

ADD REPLYlink written 8 weeks ago by b.nota6.1k

I thought scale='row' did the transformation to z-scores? that is all i am doing, introducing a beata value matrix into heatmap.2 function and setting scale to 'row'

ADD REPLYlink written 8 weeks ago by Pin.Bioinf230

Right, I overlooked scale='row' in your code, that's why I was talking about default setting. Try to make your own z-scores first, and than make a heatmap with scale='none', see if it looks better.

ADD REPLYlink written 8 weeks ago by b.nota6.1k
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: 1675 users visited in the last hour