R: package "ComplexHeatmap": oncoPrint: How to rotate column names. They default to vertical, I want horizontal
<p>using the "oncoPrint" function in "ComplexHeatmap" package I wish to rotate the column names (shown in green in attached image) from being vertical, to being horizontal as this will be easier to read.</p>

<p>I've tried lots of gpar options without success: las, rot, crt, srt</p>

<p>example: column_names_gp = gpar(las=1)</p>

<p>example: ht_global_opt(heatmap_column_names_gp=gpar(las=0))</p>

<p>This must be possible... but how?</p>

<p>Here's my amateurish code followed by some data (the gene names have been changed to protect the innocent).</p>

<hr>

<blockquote>
  <p>library(ComplexHeatmap)</p>
  
  <p>Filepath_details&lt;-file.choose()</p>
  
  <p>mat = read.table(Filepath_details, header = TRUE,stringsAsFactors=FALSE, sep = ",")</p>
  
  <p>mat[is.na(mat)] = ""</p>
  
  <p>rownames(mat) = mat[, 1]      #define row names as the sample ID.</p>
  
  <p>mat = mat[, -1]               #column 1 is now superfluous so delete it.</p>
  
  <p>mat=  mat[, -ncol(mat)]       #making sure that he whole table id selected.</p>
  
  <p>mat = t(as.matrix(mat))#turning the data into a matrix.</p>
  
  <p>mat[1:3, 1:3] #this just gives a visual check of data processing 3x3 only</p>
  
  <p>alter_fun_list = list(
       background = function(x, y, w, h) {
           grid.rect(x, y, w-unit(0.5, "mm"), h-unit(0.5, "mm"), gp = gpar(fill = "#CCCCCC", col = NA))
       },
       "nonsense"  = function(x, y, w, h) {
           grid.rect(x-0.008, y, w*0.45, h-unit(0.5, "mm"), gp = gpar(fill = "red", col = NA))
       },
       "missense"  = function(x, y, w, h) {
           grid.rect(x-0.008, y, w*0.45, h-unit(0.5, "mm"), gp = gpar(fill = "blue", col = NA))
       },
       "silent"  = function(x, y, w, h) {
           grid.rect(x+0.008, y, w*0.45, h-unit(0.5, "mm"), gp = gpar(fill = " forestgreen", col = NA))
       }
   )</p>
  
  <p>col = c("silent" = " forestgreen","nonsense" = "red", "missense" = "blue")</p>
  
  <p>oncoPrint(mat, get_type = function(x) strsplit(x, "-")[<a href="http://i.stack.imgur.com/r309Q.png" rel="nofollow">1</a>],
       alter_fun_list = alter_fun_list, col = col, show_column_names = TRUE, column_names_gp = gpar(cex=0.5, font=1, col= "green"), heatmap_legend_param = list(title = "Mutations"))</p>
</blockquote>

<hr>

<p><a href="http://i.stack.imgur.com/r309Q.png" rel="nofollow">A tiff image of some fictional gene mutation data</a></p>

<hr>

<p>some fictional data to be saved as a text file:
,TOM,DICK,HARRY,FRED,BILL,TOD,ERNIE,ANDY,SIMON,JED,WESS,GARY,PHILL,BURT,JOHN,WALT,DOUG,STAN,HUGH,CLIFF,NATH,EARL,GREG,ED,HENRY,WILL,PAUL,JACK,MICK
2,,,,,,,,,,,,,,,,,missense,,,,,,,,,,,,</p>

<p>5,,,silent,,,,,,,,,,missense,,,,,,silent-missense,,missense,,missense,,,,,,</p>

<p>6,,,,,,,,,,,,,,,,,,,,,,,,,silent,,,,</p>

<p>11,,,,,,,,silent,,,,,,,,,,,,,,,,,,,,,</p>

<p>12,,,,,,,,,,,,,,,,missense,,,,,,,,,,,,missense,</p>

<p>14,,,,,,,,,,,,,,,,,,,,,,,,,,,,missense,</p>

<p>15,,,,,,,,,,,,silent,,missense,,,,,,,,,,,,,,,</p>

<p>17,,,,,,,,silent,,,,silent,,,,,,,,,,,,,,,,missense,</p>

<p>18,,,,,missense,,,,,,,,,,,,missense,,,,,missense,,,,,,,</p>

<p>19,,,,,,,,,,,,,,,,,missense,,,,,,,,,,,,</p>

<p>20,,,silent,,,,,,,,,,,,,,,,,,,,,,,,,missense,</p>

<p>23,,,,,,,,,,,,,,missense,,,,,,,,,,,,,,nonsense,</p>

<p>27,,,,,,,,,,,,,,,,,missense,,,,,,,,,,,,</p>

<p>28,,,missense,,,,,,,silent,,,,,,,,,,,,,,,,,,missense,</p>

<p>29,,missense,,,,,,,missense,,,,,,,,,,,,,,,,,,,,</p>

<p>30,,,,,,missense,,,,,,,,,,,,,,,,,,,,,,,</p>

<p>31,,,,,,,,,,,missense,,,,,,missense,,,,,,,,,,,missense,</p>

<p>39,,,,,,,,,,,,,,,,,,missense,,,,,,,,,,,</p>

<p>42,,,,,,,,,,,,silent,,,,,missense,missense,,,,,,,silent,,,,</p>

<p>43,,,,,,,,,,silent,,,,,,,,,,,,,,,,,,missense,silent</p>

<p>45,,,,silent,,,,,,,,,,,,,,,,,,,,,,,,missense,</p>

<p>46,missense,,,,,,,,,,,,,,,,,,,,,silent-missense,,,,,,missense,</p>

<p>47,,,,,,,,,,missense,,,,,,,,,,,nonsense,,,,,,,,</p>

<p>50,,,,,,,,,,,,,,,,,missense,,,,,,,nonsense,,,,,</p>

<p>51,,,,,,,,,,,,,,,,,,,,missense,,,,,,,,,</p>

<p>52,,,,,,,,,,,,,silent,,missense,,,,silent,,,,,missense,missense,missense,silent,,</p>

<p>60,,,,,,,missense,,,,,,,,,,,,,,,,,,,,,,</p>

<p>63,,,,,,,,,,,,,,,,,,,,,,,,,,,,nonsense,</p>

<p>64,,,,,,,,,,,,,,,,,,,,missense,,,,,,,,missense,</p>

<p>65,,,,,,,,,,,,,,,,,missense,,,,,,,,,,,,</p>

<p>66,,,,,,,,,,,,,silent,,,,,,,,,,,,,,,,</p>

<hr>

<p>I really hope somebody can help me here... I've not been so stumped with R before.</p>

<p>with thanks...</p>

<p>Andrew</p>