title: heatmap.2 specify row order OR prevent reorder?
body: <p>I'm trying to generate some plots of log-transformed fold-change data using heatmap.2 (code below).</p>
  
  <p>I'd like to order the rows in the heatmap by the values in the last column (largest to smallest). The rows are being ordered automatically (I'm unsure the precise calculation used 'under the hood') and as shown in the image, there is some clustering being performed. </p>
  
  <p><strong>sample_data</strong></p>
  
  <pre><code>gid     2hrs    4hrs    6hrs    8hrs
  1234    0.5     0.75    0.9     2
  2234    0       0       1.5     2
  3234    -0.5    0.1     1       3
  4234    -0.2    -0.2    0.4     2
  5234    -0.5    1.2     1      -0.5
  6234    -0.5    1.3     2      -0.3
  7234    1       1.2    0.5      2
  8234    -1.3    -0.2    2       1.2
  9234    0.2     0.2     0.2     1
  0123    0.2     0.2     3       0.5
  </code></pre>
  
  <p><strong>code</strong></p>
  
  <pre><code>data &lt;- read.csv(infile, sep='\t',comment.char="#")
  rnames &lt;- data[,1]                 # assign labels in column 1 to "rnames"
  mat_data &lt;- data.matrix(data[,2:ncol(data)])  # transform columns into a matrix
  rownames(mat_data) &lt;- rnames                  # assign row names
  
  # custom palette
  my_palette &lt;- colorRampPalette(c("turquoise", "yellow", "red"))(n = 299)
  # (optional) defines the color breaks manually for a "skewed" color transition
  col_breaks = c(seq(-4,-1,length=100),  # for red
  seq(-1,1,length=100),              # for yellow
  seq(1,4,length=100))              # for green
  
  # plot data
  heatmap.2(mat_data,
  density.info="none",  # turns off density plot inside color legend
  trace="none",         # turns off trace lines inside the heat map
  margins =c(12,9),     # widens margins around plot
  col=my_palette,       # use on color palette defined earlier
  breaks=col_breaks,    # enable color transition at specified limits
  dendrogram='none',     # only draw a row dendrogram
  Colv=FALSE)            # turn off column clustering
  </code></pre>
  
  <p><strong>Plot</strong></p>
  
  <p><img src="https://i.stack.imgur.com/dacL2.png" alt="enter image description here"></p>
  
  <p>I'm wondering if anyone can suggest either how to turn off reordering so I can reorder my matrix by the last column and force this order to be used, or alternatively hack the heatmap.2 function to do this.</p>