Filter of taxa-bar-plots

I am seeking to either display only the most abundant taxa to the species level (taxa-bar-plots.qzv) or be able to export the taxonomy (json) into an excel or other database. For example, I would like to “filter” and export a specific genus to be displayed via the taxa-bar-plots.

On the qiime2 forum a workaround is suggested “to filter your FeatureTable[Frequency] using feature-table filter-features and then passing the filtered table to taxa barplot” Could you further explain how to use the feature-table filters? Are you referring to removing all featureIDs with the exception of the top 10?

The referenced forum is Collapse levels of taxonomy?

Please let me know if I can provide any further clarification.

Hi @moryfranklin22,

display only the most abundant taxa
Are you referring to removing all featureIDs with the exception of the top 10?

You can do this using using filter-features as outlined in the Filtering tutorial, but I suspect it might not do exactly what you're looking to do. That allows you to be able to filter features based on abundance, so what you could do is keep all features that are observed at least some number of times (see the --p-min-frequency parameter). You could look at the feature table summary (see qiime feature-table summarize, and then the Feature Detail tab. This will tell you the number of times each feature was observed across all of your samples, so will give you the information you need to set the minimum frequency parameter.

or be able to export the taxonomy (json) into an excel or other database

This functionality will be directly available in the taxonomy barplots in the 2017.7 release of QIIME 2, which will be available by the end of July. In the meantime, if you want to get the taxonomy tables at a given level as a tab-separated text file, you can do the following (imagine your taxonomy assignments are in taxonomy.qza and your feature table is table.qza):

  1. Collapse the features in your table at a specific taxonomic level. Here I'll collapse at level 2, which is the phylum:
qiime taxa collapse --i-table table.qza  --i-taxonomy taxonomy.qza  --p-level 2  --o-collapsed-table table-l2.qza
  1. Export a biom-formatted taxonomy table:
qiime tools export table-l2.qza --output-dir taxonomy-table
  1. Convert the resulting .biom table to tab-separated text, for easy loading in Excel and other tools:
biom convert --to-tsv -i taxonomy-table/feature-table.biom -o taxonomy-table/feature-table.tsv

Hope this helps!

This worked perfectly! Thank you.

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