[R] lasso/lars error
I'm having the exact problem outlined in a previous post from 2005 - unfortunately the post was never answered: http://tolstoy.newcastle.edu.au/R/help/05/10/15055.html When running: lm2=lars(x2,y,type=lasso,use.Gram=F) I get an error: Error in if (zmin gamhat) { : missing value where TRUE/FALSE needed ...when running lasso via lars() on a 67x3795 set of predictors. I hacked the lars() function to print out the zmin, gamhat, and also z1 values (used to calculate zmin) - it seems that the error comes up during the lasso process when all the z1's are negative - unfortunately I have no idea what this means. This leads to both zmin and gamhat being NA. The error can be worked around by forcing max.steps to some low value, but this isn't an ideal solution. I hope this post won't suffer the same fate as the previous one on the same topic. If I can provide any more useful information please let me know. Thanks, Jake sessionInfo() R version 2.5.0 (2007-04-23) i686-pc-linux-gnu locale: LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8;LC_COLLATE=en_US.UTF-8;LC_MONETARY=en_US.UTF-8;LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_US.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_US.UTF-8;LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods [7] base other attached packages: lars randomForest corpcor cairoDevice 0.9-7 4.5-18 1.4.52.3 [[alternative HTML version deleted]] __ 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 and provide commented, minimal, self-contained, reproducible code.
[R] conditional coloring of image labels
Hi all, I am interested in plotting a heatmap of a set of genes. I would like the text labels of these genes to be colored red rather than black if they meet certain statistical criteria (using an if statement). I'm not sure how to change individual color labels without changing them all. Can anyone provide some insight on 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
Re: [R] conditional coloring of image labels
On Friday 11 November 2005 10:37 am, Jake Michaelson wrote: I'll clarify a little and hopefully this will make more sense (thanks for the friendly encouragement): Let's say I have 6 samples and am looking at 3 genes, with intensities in a matrix as follows: genes=cbind(ABC1=c(3,4,4,5,6,3), ABC2=c(4,3,4,7,7,8), ABC3=c(8,7,8,6,3,2)) genes ABC1 ABC2 ABC3 [1,]348 [2,]437 [3,]448 [4,]576 [5,]673 [6,]382 ###plot the image image(1:nrow(genes), 1:ncol(genes), genes, axes = FALSE, xlab = , ylab = , col=cm.colors(256)) ###label the axes axis(1, 1:nrow(genes), labels = rownames(genes), las = 2, line = -0.5, tick = 0) axis(2, 1:ncol(genes), labels = colnames(genes), las = 2, line = -0.5, tick = 0) Now let's say (I'm just making these numbers and the scenario up here -- for simplicity's sake) that I had run a statistical analysis previously and wanted to label the genes that showed a significance of p 0.05. Let's say that ABC1 and ABC3 had p0.05 (assume that these values would be in a two-column matrix with the gene name and its p-value). sig=cbind(name=c(ABC1, ABC2, ABC3), pvalue=c(0.005, 0.1, 0.001)) sig name pvalue [1,] ABC1 0.005 [2,] ABC2 0.1 [3,] ABC3 0.001 I now want these (the names of the significant genes) to be labeled in red rather than black on the plot. I would eventually write a script that would generate a large number of these images, each with a different set of genes. I would like to insert some sort of conditional formatting so that if that gene meets the significance threshold, the name is automatically plotted in red on the plot. I hope this is more clear and effective in explaining what I'm looking for. Thanks, --Jake Hi all, I am interested in plotting a heatmap of a set of genes. I would like the text labels of these genes to be colored red rather than black if they meet certain statistical criteria (using an if statement). I'm not sure how to change individual color labels without changing them all. Can anyone provide some insight on 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
[R] Fwd: Re: conditional coloring of image labels
-- Forwarded Message -- Subject: Re: [R] conditional coloring of image labels Date: Friday 11 November 2005 1:04 pm From: jim holtman [EMAIL PROTECTED] To: Jake Michaelson [EMAIL PROTECTED] Use 'mtext': genes=cbind(ABC1=c(3,4,4,5,6,3), ABC2=c(4,3,4,7,7,8), ABC3=c(8,7,8,6,3,2)) ###plot the image image(1:nrow(genes), 1:ncol(genes), genes, axes = FALSE, xlab = , ylab = , col=cm.colors(256)) sig=cbind(name=c(ABC1, ABC2, ABC3), pvalue=c(0.005, 0.1, 0.001)) ###label the axes axis(1, 1:nrow(genes), labels = rownames(genes), las = 2, line = -0.5, tick = 0) mtext(colnames(genes), side=2, las = 2, line = 1, at=1:3, col=ifelse(sig[, 'pvalue'] == '0.1', 'red', 'black')) On 11/11/05, Jake Michaelson [EMAIL PROTECTED] wrote: On Friday 11 November 2005 10:37 am, Jake Michaelson wrote: I'll clarify a little and hopefully this will make more sense (thanks for the friendly encouragement): Let's say I have 6 samples and am looking at 3 genes, with intensities in a matrix as follows: genes=cbind(ABC1=c(3,4,4,5,6,3), ABC2=c(4,3,4,7,7,8), ABC3=c(8,7,8,6,3,2)) genes ABC1 ABC2 ABC3 [1,] 3 4 8 [2,] 4 3 7 [3,] 4 4 8 [4,] 5 7 6 [5,] 6 7 3 [6,] 3 8 2 ###plot the image image(1:nrow(genes), 1:ncol(genes), genes, axes = FALSE, xlab = , ylab = , col=cm.colors(256)) ###label the axes axis(1, 1:nrow(genes), labels = rownames(genes), las = 2, line = -0.5, tick = 0) axis(2, 1:ncol(genes), labels = colnames(genes), las = 2, line = -0.5, tick = 0) Now let's say (I'm just making these numbers and the scenario up here -- for simplicity's sake) that I had run a statistical analysis previously and wanted to label the genes that showed a significance of p 0.05. Let's say that ABC1 and ABC3 had p0.05 (assume that these values would be in a two-column matrix with the gene name and its p-value). sig=cbind(name=c(ABC1, ABC2, ABC3), pvalue=c(0.005, 0.1, 0.001)) sig name pvalue [1,] ABC1 0.005 [2,] ABC2 0.1 [3,] ABC3 0.001 I now want these (the names of the significant genes) to be labeled in red rather than black on the plot. I would eventually write a script that would generate a large number of these images, each with a different set of genes. I would like to insert some sort of conditional formatting so that if that gene meets the significance threshold, the name is automatically plotted in red on the plot. I hope this is more clear and effective in explaining what I'm looking for. Thanks, --Jake Hi all, I am interested in plotting a heatmap of a set of genes. I would like the text labels of these genes to be colored red rather than black if they meet certain statistical criteria (using an if statement). I'm not sure how to change individual color labels without changing them all. Can anyone provide some insight on 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 -- Jim Holtman Cincinnati, OH +1 513 247 0281 What the problem you are trying to solve? __ 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] easier way to print heatmap on multiple pages?
Hi All, I've worked on some code to take a heatmap with 1000 row entries, and split this up into 20 pages, each with 50 rows from the original heatmap. I want to preserve the row order such that all 20 pages, if put together, would comprise the original heatmap. Here's what I've done: ##make the initial heatmap, with all 1000 rows and write it to an object 'heatAll' heatAll = heatmap.2(combined.int.top, col = cm.colors(256), trace = none) pdf(file=~/Desktop/Alfalfa-Ladak-StemV3.pdf, width=8, height=12, pointsize=4) for(i in 1:20){ selected = heatAll$rowInd[((i-1)*50):((i-1)*50+50)] ##get original row order in groups of 50 heatmap.2(combined.int.top[selected,], Rowv = FALSE, ##prevent row re-ordering Colv=heatAll$colInd, col=cm.colors(256), trace=none, margins = c(9,8), main=paste(page, i, sep= )) } dev.off() I can't think of why this wouldn't work, but for some reason things are completely out of order. For example, the first page of the PDF shows many genes found at the bottom of the original heatmap, but in a different order. Strange. So, have I made this insanely complicated? Is there an easier, better way to print a large heatmap on multiple pages? Thanks in advance for any help. --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
Re: [R] make error: X11/Intrinsic.h: No such,,,
I use Mac OS X at home and Linux at work, so the R Aqua GUI has spoiled me. I have not seen its equal so far (on Windows or Linux). The most important thing to me is how easily accessible the help and documentation is. I like how when I begin typing a function, the form and arguments to the function automatically appear at the bottom bar, refreshing my memory. I like that all plots are output to on-screen PDF. I could go on and on, but I hope that someday we'll see something on Linux with the same polish and ease-of-use. Maybe when Cairo is integrated into Gnome it might make PDF plot display more feasible... On Mon, 2005-08-08 at 17:17 +0200, Martin Maechler wrote: Jake == Jake Michaelson [EMAIL PROTECTED] on Fri, 05 Aug 2005 14:39:49 -0600 writes: Jake Thanks for the help -- this morning someone (on the Jake Ubuntu boards) was kind enough to point this out to Jake me. Now if there were only a decent Linux front Jake end/gui for R... is ESS (http://ESS.r-project.org/) indecent to you ? Martin Maechler, ETH Zurich __ 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] heatmap row names as char vector?
Hi All, Could anyone help me on how to output the row names of a heatmap as a character vector? I'm looking for a way to have the names in a list (or similar) in the same order as they appear in the clustering of the heatmap. 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
Re: [R] make error: X11/Intrinsic.h: No such,,,
Thanks for the help -- this morning someone (on the Ubuntu boards) was kind enough to point this out to me. Now if there were only a decent Linux front end/gui for R... Thanks, Jake On Fri, 2005-08-05 at 13:17 -0700, Tak Ishikida wrote: I had the same problem with my ubuntu machine. A search for a Debian package that includes the header file Intrinsic.h at http://www.debian.org/distrib/packages (with stable distribution and Intel x86 architecture) turned up libdevel/libxt-dev package. I installed libxt-dev package (with the synaptic package manager) and was able to compile. Hope this helps. tak __ 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
[R] make error: X11/Intrinsic.h: No such,,,
Hi all, I'm trying to build R 2.1.1 on Ubuntu 5.04 i686-SMP. Configure goes well with: ./configure --with-BLAS --with-readline=no but once I run 'make', I get the following error: In file included from devX11.c:64: devX11.h:57:74: X11/Intrinsic.h: No such file or directory Any ideas? 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] make error: X11/Intrinsic.h: No such,,,
Hi all, I'm trying to build R 2.1.1 on Ubuntu 5.04 i686-SMP. Configure goes well with: ./configure --with-BLAS --with-readline=no but once I run 'make', I get the following error: In file included from devX11.c:64: devX11.h:57:74: X11/Intrinsic.h: No such file or directory Any ideas? 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
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
[R] reorder bug in heatmap.2?
I want to plot a heatmap without reordering the columns. This works fine in heatmap: heatmap(meanX[selected,], col=cm.colors(256), Colv=NA) But in heatmap.2 I get: heatmap.2(meanX[selected,], col=cm.colors(256), Colv=NA) Error in if (!is.logical(Colv) || Colv) ddc - reorder(ddc, Colv) : missing value where TRUE/FALSE needed (Note that instructions for the use of Colv and Rowv are identical in both heatmap and heatmap.2 documentation) Is there another way to not reorder columns in heatmap.2? 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] string/character to number
I did a very quick search of the archive and couldn't find a readily available answer to this one: I'd like to convert, for example: c(a, b, a, b) to c(1, -1, 1, -1) In the case of the first vector, it may be any length, but will always only have two unique values. It must always be replaced by corresponding values of 1 and -1. Any thoughts? 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
Re: [R] string/character to number
Duh! sub() --Jake On Jun 22, 2005, at 3:35 PM, Jake Michaelson wrote: I did a very quick search of the archive and couldn't find a readily available answer to this one: I'd like to convert, for example: c(a, b, a, b) to c(1, -1, 1, -1) In the case of the first vector, it may be any length, but will always only have two unique values. It must always be replaced by corresponding values of 1 and -1. Any thoughts? 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