heatmap2 error key
1
0
Entering edit mode
@catalina-aguilar-hurtado-6554
Last seen 4.1 years ago
United States

Hi I am trying to understand what happen with the heatmap.2 code that it used to work (last used in October 2015). I am able to get a heatmap but my colour key doesn't come up and instead I get an error in all my files the used to work. Does anyone has any idea of what could have changed? or how to fix this. 

Thanks.

#

Error in seq.default(min.raw, max.raw, by = min(diff(breaks)/100)) :
  wrong sign in 'by' argument
In addition: Warning message:
In image.default(1:nc, 1:nr, x, xlim = 0.5 + c(0, nc), ylim = 0.5 +  :
  unsorted 'breaks' will be sorted before use

##

library("RColorBrewer")
library("gplots")

library ("gtools")

GO_Fil=read.table("1h-6h-up-down-v4.csv", sep=",", header=T)

data =data.matrix (GO_Fil[,3:4]) # define which columns to use for the heatmap

rownames(data) <- GO_Fil$Description

summary (data)

pairs.breaks <- c(seq(-6, -0.01, length.out=50), seq(-0.02, 0.01,length.out=150), seq(0.02, 3.9,length.out=80))

hmcols<- colorRampPalette(c("blue","white", "red"))(length(pairs.breaks)-1)

pdf("Heat_1hv6h-updown-key.pdf",         
    width = 15,        
    height = 20,         
    pointsize = 5)

hm<- heatmap.2(data, breaks=pairs.breaks, col=hmcols, na.color="white",
               trace="none",Colv=FALSE,
               dendrogram = "none",
               density.info="none",
               key="TRUE",
               keysize = 2,
               key.xlab = "Log2FC",
               key.title = "key",
               cexCol=3.0,
               cexRow=2,         
               lwid= c(0.4,1),
               lhei = c(0.1, 4),
               margins= c(50,80),
               symm=F,symkey=F,symbreaks=T, scale="none")

dev.off()

> R.version
               _                           
platform       x86_64-apple-darwin13.4.0   
arch           x86_64                      
os             darwin13.4.0                
system         x86_64, darwin13.4.0        
status                                     
major          3                           
minor          2.2                         
year           2015                        
month          08                          
day            14                          
svn rev        69053                       
language       R                           
version.string R version 3.2.2 (2015-08-14)

heatmap.2 • 1.7k views
ADD COMMENT
1
Entering edit mode
@james-w-macdonald-5106
Last seen 2 days ago
United States

The heatmap.2 function is part of the gplots package, which is a CRAN package, not Bioconductor. Questions about CRAN packages should be directed to r-help@r-project.org.

ADD COMMENT

Login before adding your answer.

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