Entering edit mode
16 months ago
hellokwmin
•
0
Hello,
I am trying to make a heatmap. The dataframe I am using for heatmap is present in A.
Then, I assigned first and fourth columns to rownames using this code:
s = df %>%
tidyr::unite(rowname, geneid, SYMBOL) %>%
tibble::column_to_rownames()
The result is shown as (B).
Subsequently, I run this code for plotting heatmap:
as.matrix(s)
color_fun <- colorRamp2(c(-4, 0, 4), c("red", "black", "green"))
Heatmap(s,
col = color_fun,
name = "Log2FC",
row_names_side = "left",
show_row_names = T,
show_column_names = F,
cluster_rows = T,
cluster_columns = F,
show_row_dend = F,
row_names_gp = gpar(fontsize=10),
width = unit(4, "cm"),
)
The result is shown as C. But, as you can see in C. the rownames looks very complicated since geneid and symbol is not well separated each other. I would like to make rownames well clear for readers. Is there any code to cope with this issue?
Thank you
The geneid is not informative to readers anyways, just keep the symbol although you have some NAs...