I do want to cluster it and only plot the lower half of the matrix.
From: Peter Langfelder <peter.langfel...@gmail.com>
Sent: Thursday, September 15, 2016 11:33:13 PM
To: Khan, Saad M. (MU-Student)
Subject: Re: [R] Visualizing and clustering one half of a symmetric matrix
Do not set the upper (or lower) triangle to NA. Simply supply the full
matrix to pheatmap. I am not an expert on pheatmap but looking at the
manual you should supply clustering_distance_rows = "none",
clustering_distance_cols = "none" or something like that to make
pheatmap interpret the matrix as a distance matrix. Read carefully
through the help on pheatmap to make sure the function plots what you
want it to plot.
On Thu, Sep 15, 2016 at 7:38 PM, Khan, Saad M. (MU-Student)
> Hi all,
> I have a distance matrix (symmetric) which looks somewhat like this (only a
> small portion shown)
> ENSG00000101413 ENSG00000176884 ENSG00000185532
> ENSG00000101413 1.000 1.000 1.000
> ENSG00000176884 0.328 0.258 0.260
> ENSG00000185532 1.000 1.000 1.000
> ENSG00000106829 0.684 0.443 0.531
> These distances are custom measures that I need to cluster. Since it's a
> symmetric matrix I only need to consider one half triangle of the matrix. So
> I do something like this :-
> newmat <- ensembl_copygosimmat
> newmat[upper.tri(ensembl_copygosimmat)] <- NA
> Then I wanted to visualize how the lower triangle looked using pheatmap which
> does hierarchical clustering itself.
> But since there are NA values in the matrix (in the upper half) it always
> throws an error. I was wondering what would be the ideal way to visualize as
> well as cluster such a matrix.
> [[alternative HTML version deleted]]
> Remail@example.com mailing list -- To UNSUBSCRIBE and more, see
> 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]]
Rfirstname.lastname@example.org mailing list -- To UNSUBSCRIBE and more, see
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.