Create heatmap comparing two sets of data in R
I have a set of data points. It's a 6xn matrix of data points. Each row is
denoted by a unique identifier, with data points for 6 columns. What I
have is a subset of these unique identifiers that I want to compare to the
rest of the set. So I am essentially splitting the complete set into two
subsets - one of interest and one of everything else.
Now, what I would like is to have the subset of interest cluster to itself
in the heatmap, so I can compare the relative clustering within the subset
compared to everything else for all the columns. This way I can look to
see if there is any extreme differences in the profile for the subset of
interest compared to the rest of it.
As an example, my data set may look like this.
id col1 col2 col3 col4
S1 a1 a2 a3 a4
S2 b1 b2 b3 b4
S3 c1 c2 c3 c4
E4 e1 e2 e3 e4
E5 f1 f2 f3 f4
E6 g1 g2 g3 g4
E7 h1 h2 h3 h4
E8 i1 i2 i3 i4
And what I want in the heatmap is for S1-S4 to cluster together and E4-E8
to cluster together, but all of them will rest on the same z-score
gradation in the heatmap. I would want to have the values normalized by
column.
No comments:
Post a Comment