Hi, I have a question about the heatmap dendrogram in R. I loaded my data matrix in command heatmap(), and it gave me a heatmap accordingly, and the rows (genes) also were clustered accordingly. But now I don't want the genes clustered in that way, I have a new order of these genes, and want the rows of the heatmap are drawed as the order I give. Could anybody help me on that? Thank you! Yan [[alternative HTML version deleted]]
Steve Lianoglou
2011-Feb-09 17:23 UTC
[R] heatmap-how to change the order of the rows (genes)
Hi, On Wed, Feb 9, 2011 at 12:18 PM, yan liu <yanliusun at gmail.com> wrote:> Hi, > > I have a question about the heatmap dendrogram in R. ?I loaded my data > matrix in command heatmap(), and it gave me a heatmap accordingly, and the > rows (genes) also were clustered accordingly. ?But now I don't want the > genes clustered in that way, I have a new order of these genes, and want the > rows of the heatmap are drawed as the order I give. ?Could anybody help me > on that? ?Thank you!Check out the docs for heatmap a bit more carefully: R> ?heatmap I would try setting Rowv=NA, and reorder the rows of your matrix as you want them to be ordered, ie: R> heatmap(m[my.gene.order,], Rowv=NA, ...) Or something like that. -- Steve Lianoglou Graduate Student: Computational Systems Biology ?| Memorial Sloan-Kettering Cancer Center ?| Weill Medical College of Cornell University Contact Info: http://cbio.mskcc.org/~lianos/contact
Mike Marchywka
2011-Feb-09 17:25 UTC
[R] heatmap-how to change the order of the rows (genes)
----------------------------------------> Date: Wed, 9 Feb 2011 12:18:57 -0500 > From: yanliusun at gmail.com > To: r-help at r-project.org > Subject: [R] heatmap-how to change the order of the rows (genes) > > Hi, > > I have a question about the heatmap dendrogram in R. I loaded my data > matrix in command heatmap(), and it gave me a heatmap accordingly, and the > rows (genes) also were clustered accordingly. But now I don't want the > genes clustered in that way, I have a new order of these genes, and want the > rows of the heatmap are drawed as the order I give. Could anybody help me[[elided Hotmail spam]]>?heatmap Rowv=NA or Colv=NA but first time I tried this something didn't work but I think eventually it did work for me with both, not sure if you have problem with one only.> Yan > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org 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.