I have microbiome data with OTUs identified to the lowest taxonomic level possible. Some of the OTUs are identified to genus, others to family, order, etc. I need to create a stacked bar chart.
My problem:
- If I choose "genus" for my bar chart, anything that is not identified to the genus level is shown as "Unknown" on the chart.
- If I choose a higher level, I lose specificity.
How can I create a bar chart with the best taxonomic resolution for my data?
Thank you!
You could put all genera, families etc. that are less than 5% of the relative abundance into one category. That way any low count OTUs are combined into one category, making your legend cleaner. Or you could remove all your unidentified genera, but it would be wise to make a note on the percentage or number or reads/ taxa that are removed because of this.
Here is some example code for combining otus that are less than whatever percentage that you want.