Hi all,
For plotting heatmap, I used pheatmap just by taking numerical values but not sure how to annotate and to divide heatmap based on column category.
Code which I used just taking numeral value;
x <- read.table("pheatmap.txt",sep="\t",head=T,row.names=1,check.names=F)
library('pheatmap')
pdf("16s.pdf", height=20,width=13)
pheatmap(x,scale="row",color =colorRampPalette(c('blue','yellow'))(12),cluster_cols =F,show_colnames = T,cluster_row=T,border_color="NA", fontsize_row=10,fontsize =10)
dev.off();
Now Could you please help how should I take only numerical value from the below file for pheatmap and then how to divide the plot into three different category; leaf, root, soil, and then want to add a color bar on top based on season?
Season dry dry wet wet dry dry wet wet dry dry wet wet
Compartment Leaf Leaf Leaf Leaf Root Root Root Root Soil Soil Soil Soil
Burkholderiaceae0 0 0 0.103 0.244 0.001 0.143 0.08 0.032 0.01 0.01 0.032
Bradyrhizobium 0 0 0 0 0.1354 0.094 0.12 0.16 0.211 0.005 0.00744 0.006
Anaeromyxobacter0.04 0 0 0 0.0874 0.139 0.058 0.07 0.11 0.06 0.026 0.034
Geobacter 0.001 0.0004 0 0 0.01 0.016 0.0146 0.08 0.016 0.05 0.0283 0.02
Microbacterium 0.31 0 0.02 0.038 0.003 0.03 0.0038 0.0 0 0.002 0.008 0.002
Rhizobiales 0 0 0 0 0.008 0.001 0.011 0.01 0.0121 0.01 0.4 0.0164
I would like to get image like this and also shown in this publication Fig1 (https://www.nature.com/articles/s41396-021-00974-2); instead of soil type I want to have Compartment; leaf, root, soil and then season (wet/dry) at the top
Many thanks,