Log scale in pheatmap with R

586 Views Asked by At

my_data looks like: enter image description here

my_aroma_col:

enter image description here

and my_sample_col:

enter image description here

I would like to make a scale with pheatmap that starts at zero and the next values are 10^5, 10^6, 10^7, 10^8. Here is the figure with the example mentioned above:

enter image description here

I used this code:

library(pheatmap)
my_data <- read.csv2("C:/Users/cikhote/Desktop/Meu PC 12.09/Thèse Caroline 2/Article 4 - Aromes cheese-agar/Article Tables and Figures/Heatmap Aromes/91_molec.csv", dec=".", stringsAsFactors = FALSE, header = TRUE, row.names = "Name")
my_matrix <- as.matrix (my_data)

my_aroma_col <- read.csv2("C:/Users/cikhote/Desktop/Meu PC 12.09/Thèse Caroline 2/Article 4 - Aromes cheese-agar/Article Tables and Figures/Heatmap Aromes/91_aroma_col.csv", dec=".", stringsAsFactors = FALSE, header = TRUE, row.names = "Name")
my_sample_col <- read.csv2("C:/Users/cikhote/Desktop/Meu PC 12.09/Thèse Caroline 2/Article 4 - Aromes cheese-agar/Article Tables and Figures/Heatmap Aromes/sample_col.csv", dec=".", stringsAsFactors = FALSE, header = TRUE, row.names = "Sample")

annotation_colors = list(
    Genera = c(Control= "darkgrey", Halomonas="darkorange", Pseudoalteromonas="darkgreen", Psychrobacter="blue"),
    Origin = c(Control= "darkgrey", Cheese="gold", Environmental="skyblue1", Food="orchid"),
    Class = c(Alcohols ="beige", Aldehydes ="lightpink", "Carboxylic acids" ="olivedrab1", Esters ="lightblue2", Ketones ="plum1", Pyrazines ="peachpuff", "Sulphur Compounds"="tan3", Others = "black"))

my_matrix[my_matrix == 0] <- NA
windows()

pheatmap(my_matrix, cluster_rows=FALSE, cutree_cols = 8, annotation_row = my_aroma_col, annotation_col = my_sample_col, annotation_colors = annotation_colors, fontsize = 7, angle.col=90)

Does anybody know how to do this breaks?

0

There are 0 best solutions below