# How to combine low frequency taxa into an "other" category on barplot?

**URL:** https://forum.qiime2.org/t/how-to-combine-low-frequency-taxa-into-an-other-category-on-barplot/21138
**Category:** User Support
**Tags:** taxonomy, feature-classifier, barplot
**Created:** [October 21, 2021, 4:09pm UTC](https://forum.qiime2.org/t/how-to-combine-low-frequency-taxa-into-an-other-category-on-barplot/21138 "2021-10-21T16:09:16Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![MicrobeManager](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/m/e19adc/32.png) [@MicrobeManager](https://forum.qiime2.org/u/MicrobeManager)
#### Post date: [October 21, 2021, 4:09pm UTC](https://forum.qiime2.org/t/how-to-combine-low-frequency-taxa-into-an-other-category-on-barplot/21138/1 "2021-10-21T16:09:16Z")

</div>

Thanks to the help I've received on the forums, I have completed my first QIIME2 workflow and produced a number of barplots, PCoAs, etc from the analysis. I am interested in publishing some barplots of order-level taxa for each group of samples, but there are many low-frequency taxa that are invisible on the plots but taking up lots of space on the legend. I'd like to merge taxa below a set relative frequency threshold (2% but maybe more) into an "other" category to clean up the visualization. Is there a way to do this in QIIME2? Thanks for the help!

---

<div class="post-metadata">

### Author: ![timanix](https://forum.qiime2.org/user_avatar/forum.qiime2.org/timanix/32/17879_2.png) [@timanix](https://forum.qiime2.org/u/timanix)
#### Post date: [October 22, 2021, 7:08am UTC](https://forum.qiime2.org/t/how-to-combine-low-frequency-taxa-into-an-other-category-on-barplot/21138/2 "2021-10-22T07:08:03Z")

</div>

Hello! I do not think that you can achieve this goal using Qiime2 standard tools (please, correct me if I am wrong). But here are some alternatives:

1. Use Qiime2 generated barplot as it is and modify a legend (just cut it) and explain in the figure description that legend represent only top N taxa.
2. In the barplot, if you will click on the color box in legend, it will show you only this taxa on the barplot. You can just click on the top N taxa in the legend, and everything else will be without color. Use this image and cut the legend correspondingly.
3. Modify barplot and legend as svg files in any svg editor.
4. Download taxa counts from the barplot as csv and plot it using R or Python.

---

<div class="post-metadata">

### Author: ![MicrobeManager](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/m/e19adc/32.png) [@MicrobeManager](https://forum.qiime2.org/u/MicrobeManager)
#### Post date: [October 22, 2021, 3:11pm UTC](https://forum.qiime2.org/t/how-to-combine-low-frequency-taxa-into-an-other-category-on-barplot/21138/3 "2021-10-22T15:11:34Z")

</div>

Hi Timur, thanks for the reply. Some of the taxa are invisible in the group but when I click on them in the bar legend in QIIME2 view I see faint lines appear, so it might be hard to physically cut the graph. I think I may try to do this in R or Python, or even download the values into Prism to make easy stacked bar graphs and then I can just sum the remaining taxa into a 2% category that way.

---

<div class="post-metadata">

### Author: ![system](https://forum-qiime2-org.s3.dualstack.us-west-2.amazonaws.com/original/3X/2/1/21af5fe23cb6f4579467c66a9ed94e55274ca7bd.svg) [@system](https://forum.qiime2.org/u/system)
#### Post date: [November 22, 2021, 9:12pm UTC](https://forum.qiime2.org/t/how-to-combine-low-frequency-taxa-into-an-other-category-on-barplot/21138/4 "2021-11-22T21:12:04Z")

</div>

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
