[R] hclust in heatmap.2

3 views
Skip to first unread message

affy snp

unread,
Dec 5, 2007, 7:20:33 PM12/5/07
to r-h...@r-project.org
Dear list,

I am using heatmap.2(x) to draw a heatmap. Ideally, I want to the matrix
x clustered only by columns and keep the original order of rows unchanged.
Is there a way to do that in heatmap.2()?

Thanks a lot! Any suggestions will be appreciated!

Best,
Allen

[[alternative HTML version deleted]]

______________________________________________
R-h...@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.

Ashoka Polpitiya

unread,
Dec 6, 2007, 12:27:42 AM12/6/07
to affy snp, r-h...@r-project.org
Check the Rowv, Colv options to heatmap.2

data(mtcars)
x <- as.matrix(mtcars)
heatmap.2(x, Rowv=FALSE, dendrogram="column")

-Ashoka
----
Scientist - Pacific Northwest National Lab

James W. MacDonald

unread,
Dec 6, 2007, 9:21:44 AM12/6/07
to affy snp, r-h...@r-project.org

affy snp wrote:
> Dear list,
>
> I am using heatmap.2(x) to draw a heatmap. Ideally, I want to the matrix
> x clustered only by columns and keep the original order of rows unchanged.
> Is there a way to do that in heatmap.2()?
>
> Thanks a lot! Any suggestions will be appreciated!

From the help page:

Arguments:

x: numeric matrix of the values to be plotted.

Rowv: determines if and how the _row_ dendrogram should be
reordered. By default, it is TRUE, which implies dendrogram
is computed and reordered based on row means. If NULL or
FALSE, then no dendrogram is computed and reordering is done.
If a 'dendrogram', then it is used "as-is", ie without any
reordering. If a vector of integers, then dendrogram is
computed and reordered based on the order of the vector.


>
> Best,
> Allen
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-h...@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.

--
James W. MacDonald, M.S.
Biostatistician
Affymetrix and cDNA Microarray Core
University of Michigan Cancer Center
1500 E. Medical Center Drive
7410 CCGC
Ann Arbor MI 48109
734-647-5623

affy snp

unread,
Dec 6, 2007, 11:06:53 AM12/6/07
to Ashoka Polpitiya, r-h...@r-project.org
Thanks Ashoka!

Allen

On Dec 6, 2007 12:27 AM, Ashoka Polpitiya <ashoka.p...@gmail.com>
wrote:

affy snp

unread,
Dec 6, 2007, 11:07:10 AM12/6/07
to James W. MacDonald, r-h...@r-project.org
Thanks James!

Allen

Reply all
Reply to author
Forward
0 new messages