Is it possible to customize the taxa_barplot further? I am splitting my samples into 10 patients and I was hoping to customize the layout of the plot so my faceted figures are in 2 rows of 5 instead of 1 row of 10.
For example, for "cateogry" in taxa_barplot I am using my patient ID's, but can I adjust the placement of the facets instead of having them squashed next to eachother?
Also, for the legend can I have it so only the Genus is displayed rather than the entire taxon string? E.g. Staphylcocccus instead of Bactera;Firmicutes;etc
Hi! As far as I know, there is no way to do it in Qiime2, but you can use Python or R to redraw it. Or manipulate the produced image in some editor.
You can download legend as a .svg file and edit it in svg editor (inkspace) or with a script. But if you redraw your figure in R or Python, you can modify it there.
I was hoping to do it in R. I generated the image using the taxa_barplot function that is part of the Qiime2R package, I was hoping there was a way to customize the code to alter the layout of the figure regarding how the facets are arragned.
I was also hoping to alter the legend in R as well to collapse the text to genus only. I can redraw the figure I'm just not sure how to manipulate the data in R to do it.
You can manipulate the table that contains taxonomy names to split taxonomy names and leave only Genus level annotations and recreate the plot with modified information. Also you can create your own barplot with subplots (2 rows by 5 columns), custom order and so on. But it is already pure R, not Qiime2.
I used Python to create my barplot like this:
For this example, I used Dokdo's taxa_abundance_plot method on the taxa-bar-plots.qzv file from the famous "Moving Pictures" tutorial (see the Dokdo API for more details on the method). You should be able to recreate the example using the code shown below.
In addition to plotting taxonomic bar plots, you can also use the Dokdo API for plotting many other types of figures, including PCoA and alpha rarefaction curve plots which cannot be easily customized within QIIME 2 Visualizations.