[BioC] different color for a subset of points on heatmap

David Schruth dschruth at u.washington.edu
Mon Jun 21 20:07:45 CEST 2010


You could try using densCols:

my.colors <- c('red','blue','purple','orange')
x =lapply(seq(2,10,by=2), function(j) rnorm(1000,j))
y =lapply(seq(2,10,by=2), function(k) rnorm(1000,k))
plot(1,1,xlim=c(0,10),ylim=c(0,10), pch='')
lapply(1:4, function(i) points(x[[i]],y[[i]], 
col=densCols(x[[i]],y[[i]], 
col=colorRampPalette(c('white',my.colors[i]))), pch=3))


marek piatek (BI) wrote:
> Hi Francois and all,
>
> Thanks for your advice. However if I will give my subset different values they will get clustered in different way - which is not what I want. Your approach is good if I wouldn't be using clustering.
> And also the subset I would like to use different colour for is a subset of larger population (its min and max values are within the larger set).
>
> Any other ideas?
>
> Thank you in advance,
> Marek
>
>
> -----Original Message-----
> From: Francois Pepin [mailto:francois at sus.mcgill.ca] 
> Sent: 18 June 2010 20:41
> To: marek piatek (BI)
> Cc: bioconductor at stat.math.ethz.ch
> Subject: Re: [BioC] different color for a subset of points on heatmap
>
> HI Marek,
>
> The easiest way I can think of:
>
> One would be give those genes a different set of values. So if all your data is between -5 to 5, have the special genes from say 10 to 20. Then you can send it a set of colors that covers everything.
>
> Here's an example where half is positive and half is negative. You can see the transparent colors in half of the columns as opposed to the non-transparent ones otherwise.
>
>   
>> heatmap(matrix(c(1,runif(49),-1,-runif(49)),10),col=cbind(heat.colors(20,alpha=0.25),heat.colors(20,alpha=1)))
>>     
>
> You'll need to be a bit careful to get the colors to match. I put the 1 and -1 to make sure that we cover the range and the colors and and values match.
>
> HTH,
>
> Francois
>
> On Jun 18, 2010, at 6:38 AM, marek piatek (BI) wrote:
>
>   
>> Hi all,
>>
>> Is there any way to use different color on a subset of points on a heatmap?
>> I just would like see a particular set of genes standing out from the rest.
>>
>> Thank you,
>> Marek
>>
>> _______________________________________________
>> Bioconductor mailing list
>> Bioconductor at stat.math.ethz.ch
>> https://stat.ethz.ch/mailman/listinfo/bioconductor
>> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
>>     
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
>



More information about the Bioconductor mailing list