pheatmap is a great package for making nice heatmaps in R.
The ps_pheatmap is a function in MicEco, which wraps the pheatmap function to make pretty heatmaps easily directly from phyloseq objects.
# Packages needed
library(MicEco) # https://github.com/Russel88/MicEco
# Data
library(phyloseq)
load("../data/physeq.RData")
Here we agglomorate the taxa to the Class level (tax_agg = "Class"). We filter by classes at least present in 10 samples (min_samples = 10). We annotate by the Time variable (annot_samp = "Time"). All in one go.
ps_pheatmap accepts similar arguments as the original pheatmap function. So we can for example also hide the column names (show_colnames = FALSE).
By default, abundances are transformed to relative abundances, these are then log10 transformed. The default color map is viridis::viridis, with absent taxa as black. Taxa are ordered by average abundance.
ps_pheatmap(phy, tax_agg = "Class",
min_samples = 10,
annot_samp = "Time",
show_colnames = FALSE)