Hello, I have a dataset of 985 genes, looks something like the ones below. I want to label only those with the high intensities, since labeling all doesn't show up. Is there a way to do that? If not, is there a way to pull out the highest ones (say, highest 50, or those above X amount) and only show those in a heat map? Thanks! -Angela Z transforming gives all cells the same value, just + or - (for example, all have 0.5 and -0.5). The researchers want the actual values used. Gene var1 var2 A 8000000 0 B 250000 300000 C 750000 2000000 D 0 0 E 4000000 6000000 E 5000000 700000 E 1000000 1000000 F 6000000 6000000 F 700000 827460 G 420930 400000 H 0 0 H 1000000 1000000 I 700000 600000 J 0 700000 K 0 0 L 200000 500000 L 1000000 3000000
Hi Angela, Assuming the above data frame is named angela.df: angela.mat<-as.matrix(angela.df[,2:3]) angela.mat<-angela.mat[apply(angela.mat,1,function(x) all(x) > 0),] will remove all of the rows that have contain at least one zero. Jim On Fri, Aug 28, 2015 at 9:00 AM, Angela via R-help <r-help at r-project.org> wrote:> Hello, > > I have a dataset of 985 genes, looks something like the ones below. I want > to label only those with the high intensities, since labeling all doesn't > show up. Is there a way to do that? If not, is there a way to pull out the > highest ones (say, highest 50, or those above X amount) and only show those > in a heat map? Thanks! > > -Angela > > Z transforming gives all cells the same value, just + or - (for example, > all have 0.5 and -0.5). The researchers want the actual values used. > > Gene var1 var2 > A 8000000 0 > B 250000 300000 > C 750000 2000000 > D 0 0 > E 4000000 6000000 > E 5000000 700000 > E 1000000 1000000 > F 6000000 6000000 > F 700000 827460 > G 420930 400000 > H 0 0 > H 1000000 1000000 > I 700000 600000 > J 0 700000 > K 0 0 > L 200000 500000 > L 1000000 3000000 > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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. >[[alternative HTML version deleted]]
Hi Jim, Thank you, that definitely reduced it but there are still about 600 genes, so too many to label. It does make the heat map itself look cleaner. Maybe labeling isn't necessary for the heat map? -Angela -------------------------------------------- On Fri, 8/28/15, Jim Lemon <drjimlemon at gmail.com> wrote: Subject: Re: [R] heat map labeling Cc: "r-help mailing list" <r-help at r-project.org> Date: Friday, August 28, 2015, 6:16 AM Hi Angela,Assuming the above data frame is named angela.df: angela.mat<-as.matrix(angela.df[,2:3])angela.mat<-angela.mat[apply(angela.mat,1,function(x) all(x) > 0),] will remove all of the rows that have contain at least one zero. Jim On Fri, Aug 28, 2015 at 9:00 AM, Angela via R-help <r-help at r-project.org> wrote: Hello, I have a dataset of 985 genes, looks something like the ones below. I want to label only those with the high intensities, since labeling all doesn't show up. Is there a way to do that? If not, is there a way to pull out the highest ones (say, highest 50, or those above X amount) and only show [[elided Yahoo spam]] -Angela Z transforming gives all cells the same value, just + or - (for example, all have 0.5 and -0.5). The researchers want the actual values used. Gene? ?var1? ? ? ?var2 A? ? ? ?8000000 0 B? ? ? ?250000? 300000 C? ? ? ?750000? 2000000 D? ? ? ?0? ? ? ? ? ? ? ?0 E? ? ? ?4000000 6000000 E? ? ? ?5000000 700000 E? ? ? ?1000000 1000000 F? ? ? ?6000000 6000000 F? ? ? ?700000? 827460 G? ? ? ?420930? 400000 H? ? ? ?0? ? ? ? ? ? ? ?0 H? ? ? ?1000000 1000000 I? ? ? ?700000? 600000 J? ? ? ?0? ? ? ? ? ? ? ?700000 K? ? ? ?0? ? ? ? ? ? ? ?0 L? ? ? ?200000? 500000 L? ? ? ?1000000 3000000 ______________________________________________ R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.