Re: [R] heatmap color distribution

2005-07-21 Thread Wiener, Matthew
You can use the breaks argument in image to do this.  (You don't specify a
function you're using, but other heatmap functions probably have a similar
parameter.)  Look across all your data, figure out the ranges you want to
have different colors, and specify the appropriate break points in each call
to image.  Then you're using the same color set in each one.  You run the
risk, of course, that some of your images will have a very narrow color
range, which might obscure interesting features.  But nothing stops you from
making more than one plot.

Hope this helps.

Regards,

Matt Wiener

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Jacob Michaelson
Sent: Thursday, July 21, 2005 9:26 AM
To: r-help@stat.math.ethz.ch
Subject: [R] heatmap color distribution


Hi all,

I've got a set of gene expression data, and I'm plotting several  
heatmaps for subsets of the whole set.  I'd like the heatmaps to have  
the same color distribution, so that comparisons may be made  
(roughly) across heatmaps; this would require that the color  
distribution and distance functions be based on the entire dataset,  
rather than on individual subsets.  Does anyone know how to do this?

Thanks in advance,

Jake

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] heatmap color distribution

2005-07-21 Thread Jake Michaelson
Thanks for the reply.  As I understand it, breaks only controls the  
binning.  The problem I'm having is that each subset heatmap has  
slightly different min and max log2 intensities.  I'd like the colors  
to be based on the overall (complete set) max and min, not the subsets'  
max and min -- I could be wrong, but I don't think breaks will help  
me there.  And you're right - this might obscure some of the  
trends/features, but we'll also plot the default heatmaps.

Also (I should have specified) I'm using heatmap.2.

Thanks,

Jake

On Jul 21, 2005, at 8:09 AM, Wiener, Matthew wrote:

 You can use the breaks argument in image to do this.  (You don't  
 specify a
 function you're using, but other heatmap functions probably have a  
 similar
 parameter.)  Look across all your data, figure out the ranges you want  
 to
 have different colors, and specify the appropriate break points in  
 each call
 to image.  Then you're using the same color set in each one.  You run  
 the
 risk, of course, that some of your images will have a very narrow color
 range, which might obscure interesting features.  But nothing stops  
 you from
 making more than one plot.

 Hope this helps.

 Regards,

 Matt Wiener

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Jacob Michaelson
 Sent: Thursday, July 21, 2005 9:26 AM
 To: r-help@stat.math.ethz.ch
 Subject: [R] heatmap color distribution


 Hi all,

 I've got a set of gene expression data, and I'm plotting several
 heatmaps for subsets of the whole set.  I'd like the heatmaps to have
 the same color distribution, so that comparisons may be made
 (roughly) across heatmaps; this would require that the color
 distribution and distance functions be based on the entire dataset,
 rather than on individual subsets.  Does anyone know how to do this?

 Thanks in advance,

 Jake

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide!
 http://www.R-project.org/posting-guide.html





 --- 
 ---
 Notice:  This e-mail message, together with any attachment...{{dropped}}

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] heatmap color distribution

2005-07-21 Thread Wiener, Matthew
Breaks affects the binning into colors.  Try this.  Assume that temp is one
of your data sets.  It's values are restricted to 0.25 - 0.75, and we'll
assume that the full data set goes from 0 to 1.

 temp - matrix(runif(60, 0.25, 0.75), nc = 6)
 breaks - seq(from = 0, to = 1, length = 11)
 image(temp2, col = heat.colors(10)) # full range of
color
 image(temp2, col = heat.colors(10), breaks = breaks)# muted colors

The second image is told about all the colors, and about the full range of
data through breaks, and only uses the colors in the middle.

Is that what you mean?

HTH, 

Matt

-Original Message-
From: Jake Michaelson [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 21, 2005 10:45 AM
To: Wiener, Matthew
Cc: R-help@stat.math.ethz.ch
Subject: Re: [R] heatmap color distribution


Thanks for the reply.  As I understand it, breaks only controls the  
binning.  The problem I'm having is that each subset heatmap has  
slightly different min and max log2 intensities.  I'd like the colors  
to be based on the overall (complete set) max and min, not the subsets'  
max and min -- I could be wrong, but I don't think breaks will help  
me there.  And you're right - this might obscure some of the  
trends/features, but we'll also plot the default heatmaps.

Also (I should have specified) I'm using heatmap.2.

Thanks,

Jake

On Jul 21, 2005, at 8:09 AM, Wiener, Matthew wrote:

 You can use the breaks argument in image to do this.  (You don't  
 specify a
 function you're using, but other heatmap functions probably have a  
 similar
 parameter.)  Look across all your data, figure out the ranges you want  
 to
 have different colors, and specify the appropriate break points in  
 each call
 to image.  Then you're using the same color set in each one.  You run  
 the
 risk, of course, that some of your images will have a very narrow color
 range, which might obscure interesting features.  But nothing stops  
 you from
 making more than one plot.

 Hope this helps.

 Regards,

 Matt Wiener

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Jacob Michaelson
 Sent: Thursday, July 21, 2005 9:26 AM
 To: r-help@stat.math.ethz.ch
 Subject: [R] heatmap color distribution


 Hi all,

 I've got a set of gene expression data, and I'm plotting several
 heatmaps for subsets of the whole set.  I'd like the heatmaps to have
 the same color distribution, so that comparisons may be made
 (roughly) across heatmaps; this would require that the color
 distribution and distance functions be based on the entire dataset,
 rather than on individual subsets.  Does anyone know how to do this?

 Thanks in advance,

 Jake

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide!
 http://www.R-project.org/posting-guide.html





 --- 
 ---
 Notice:  This e-mail message, together with any attachment...{{dropped}}

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] heatmap color distribution

2005-07-21 Thread Ruben Roa
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Behalf Of Jacob Michaelson
 Sent: 21 July 2005 12:26
 To: r-help@stat.math.ethz.ch
 Subject: [R] heatmap color distribution
 
 
 Hi all,
 
 I've got a set of gene expression data, and I'm plotting several  
 heatmaps for subsets of the whole set.  I'd like the heatmaps 
 to have  the same color distribution, so that comparisons may be made  
 (roughly) across heatmaps; this would require that the color  
 distribution and distance functions be based on the entire dataset,  
 rather than on individual subsets.  Does anyone know how to do this?
 
 Thanks in advance,

For each heatmap, in image() set the zlim argument to c(zmin,zmax) where 
zmin and zmax are the minimum and maximum observed across the entire data 
set. Also, for each heatmap set col=heat.colors(n) to the same n for all 
heatmaps. I do that with image.kriging in geoR. Hope it works for you.
Ruben

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html