View Single Post
Old 08-23-2013, 05:36 AM   #6
Senior Member
Location: Gainesville

Join Date: Apr 2012
Posts: 140

Originally Posted by jmw86069 View Post
Well the "breaks are not unique" part is straightforward, just try this:

bk <- unique(c(seq(-0.1,0, length=100), seq(0,0.4,length=100),seq(0.4,13,length=100)));
It is caused by concatenating several seq() results together, which share the same boundaries.

I'm testing out your code now, just have to create a matrix m1 to make it reproducible before I post back with an example that works.

Thanks! it worked with your method. the reason I want to map the value to colour is that I want to compare different heatmaps just by the colour.

I have two matrix, but the data range is different
one is from -0.1 to 9
the other is from -0.1 to 12

I think I just have to play around with the colour scheme to make my heatmap look better.

It is from ChIP-seq data. I plot the tag intensity around TSS.

bk = unique(c(seq(-0.1,0.5, length=100),seq(0.5,13,length=100)))
hmcols<- colorRampPalette(c("white","red4"))(length(bk)-1)

the previous code gave me a lot "red" background which I do not want.

Thank you again!
crazyhottommy is offline   Reply With Quote