Facet Taxa axis in Phyloseq heatmap

54 Views Asked by At

I'm trying to plot a heatmap of ASV composition, but I would like to group all the taxa with the same name in the x-axis to simplify visualization. I managed to do it with the y-axis categorical variable. But I cannot do it with the taxa axis...

Apreciate any help =D

Example script:

library(phyloseq)
library(ggplot2)
library(ggpubr)
library(ggh4x)

data("GlobalPatterns")
gpac <- subset_taxa(GlobalPatterns, Phylum=="Crenarchaeota")
gpac = prune_samples(sample_sums(gpac) > 50, gpac)

plot_heatmap(gpac, method=NULL, sample.label="SampleType", low="yellow", high="red", 
             taxa.label="Family", taxa.order="Phylum", na.value="white") +
  facet_grid2(cols=vars(SampleType), scales="free_x", independent = "x") +
  rremove("x.text") + rremove("xlab")

Heatmap

0

There are 0 best solutions below