title: drawing heatmap with dendrogram along with sample labels
body: <p>Using the <code>heatmap</code> function of <code>made4</code>, I made this heatmap dendrogram from the example file:</p>
  
  <pre><code>data(khan)
  heatplot(khan$train[1:30,], lowcol="blue", highcol="red")
  </code></pre>
  
  <p>How can I add a panel of labels for the samples on the edges of the heatmap, like in this figure?</p>
  
  <p><img src="https://i.stack.imgur.com/1qTWn.png" alt="enter image description here"></p>
  
  <p>The labels in this case are the squares that are adjacent to the heatmap first col and top row, used to denote a label for each sample so that one can see if the labels correspond with the clustering shown by the heatmap/dendrogram. In this particular plot they chose to make those labels correspond exactly to the colors of the dendrogram clusters but it doesn't have to be this way, I'm looking for way to just add a generic column and row of labels to the samples which might not correspond to the clustering resulting from applying a particular threshold of the dendrogram.</p>
  
  <p>The <code>heatmap</code> function and the <code>khan</code> data is from <code>made4</code>:</p>
  
  <pre><code>require(made4)
  </code></pre>
  
  <p>see <a href="http://www.bioinf.ucd.ie/people/aedin/R/pages/made4/html/heatplot.html" rel="nofollow noreferrer">http://www.bioinf.ucd.ie/people/aedin/R/pages/made4/html/heatplot.html</a></p>
  
  <p>I'm happy to use alternatives to <code>heatplot</code> that can draw the same thing, a heatmap with two dendrograms along the side based on hierarchical clustering. <code>heatplot</code> is just an example.</p>
  
  <p>When I try <code>heatmap.2</code> like @HeatherTurner suggested I get this image (not sure how to turn off row/column labels on matrix to make it less clustered):</p>
  
  <p><img src="https://i.stack.imgur.com/kWqoA.png" alt="enter image description here"></p>
  
  <p>The heatmap looks corrupted. Here's code that reproduces this with a small data set:</p>
  
  <pre><code>require(gplots)
  data(khan)
  heatmap.2(as.matrix(khan$train[1:30,])
  </code></pre>
  
  <p>which generates this:
  <img src="https://i.stack.imgur.com/XELyS.png" alt="enter image description here"></p>
  
  <p>What is causing these corrupted looking heatmaps? </p>
  
  <p><em>update</em>: apologies, I think the heatmaps are not corrupted it's just the <code>trace</code> column is on which causes the cyan line to be drawn through heatmap. setting <code>trace=none</code> resolves the issue.</p>
  
  <p>ps it looks like <code>heatmap</code> has <code>RowSideCols</code>, which might be same argument?</p>