RE: Errors with -Inf
1
0
Entering edit mode
@michael-watson-iah-c-378
Last seen 9.6 years ago
Sorry, useless e-mail program..... Hi This is obviously a wider problem, I think, than simply within limma, where I found it. The command: > imageplot(log2(RG$Rb[,8]), RG$printer, low="white", high="red") Produces the error: Error in image.default(0:(gr * sr), 0:(gc * sc), z, zlim = zlim, col = col, : invalid z limits All my other arrays work fine. The only difference here is that in array 8, some of the values for Rb are zero. > summary(RG$Rb[,8]) Min. 1st Qu. Median Mean 3rd Qu. Max. 0.00 37.00 39.00 39.48 42.00 76.00 So therefore: > summary(log2(RG$Rb[,8])) Min. 1st Qu. Median Mean 3rd Qu. Max. -Inf 5.209 5.285 -Inf 5.392 6.248 R calculates my average log2(Rb) as being -Inf, which I'm guessing is whats screwing up the imageplot() function. So, um, any ideas what to do about this? Estimates of background that are zero must be pretty rare, but that's the data I have and I don't see that it is necessarily invalid.... Thanks Mick
limma limma • 951 views
ADD COMMENT
0
Entering edit mode
@gordon-smyth
Last seen 19 minutes ago
WEHI, Melbourne, Australia
> Hi > > This is obviously a wider problem, I think, than simply within limma, > where I found it. > > The command: > >> imageplot(log2(RG$Rb[,8]), RG$printer, low="white", high="red") > > Produces the error: > > Error in image.default(0:(gr * sr), 0:(gc * sc), z, zlim = zlim, col = > col, : > invalid z limits > > All my other arrays work fine. The only difference here is that in > array 8, some of the values for Rb are zero. > >> summary(RG$Rb[,8]) > Min. 1st Qu. Median Mean 3rd Qu. Max. > 0.00 37.00 39.00 39.48 42.00 76.00 > > So therefore: > >> summary(log2(RG$Rb[,8])) > Min. 1st Qu. Median Mean 3rd Qu. Max. > -Inf 5.209 5.285 -Inf 5.392 6.248 > > R calculates my average log2(Rb) as being -Inf, which I'm guessing is > whats screwing up the imageplot() function. Well yes. The error message certainly could be more informative but, leaving that aside, the problem is not with the imageplot() function but with the fact that you have computed the log of zero and then passed an infinite value to imageplot(). What do you expect an image plot to do when it gets an infinite value? > So, um, any ideas what to do about this? Estimates of background that > are zero must be pretty rare, but that's the data I have and I don't see > that it is necessarily invalid.... You could use a transformation that doesn't give infinite values, e.g., imageplot( RG$Rb[,8]^0.1 , RG$printer) or else you could tell the imageplot() function that it doesn't need to represent the entire data range: zlim <- quantile(RG$Rb[,8],c(0.5,0.95)) imageplot( RG$Rb[,8], RG$printer, zlim=zlim) Gordon > Thanks > Mick
ADD COMMENT

Login before adding your answer.

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