Retain all ASVs collapsing to specific genera

Dear community, I need help with the following:

I have a feature table (ASVs) that collapses into more than 1,000 genera. However, I am interested only in a core-group of about 70 genera.

My question is: is there a way to filter my ASV table to retain only those ASVs that collapse into the 70 genera of interest?

I don't know if I explained properly...

Thanks in advance!!

Hello!
Please, check filtering tutorial, especially taxonomy based part of it, and this post. You can find right commands in the tutorial and examples in the post.

1 Like

Hi @timanix , thanks for your quick answer!

I am trying to build my command, something similar to this

qiime taxa filter-table
--i-table table-1.qza
--i-taxonomy TAXA/taxonomy-1.qza
--p-include g__Moraxella,g__Oscillospira,g__Prevotella
--o-filtered-table filtered_all_taxa_to_keep.qza

It worked when I only added classified genera. However, I am having problems when I have to add unclassified genera (classified to family or order), such as these:

  • k__Bacteria;p__Bacteroidetes;c__Bacteroidia;o__Bacteroidales;f__S24-7;g__
  • k__Bacteria;p__Bacteroidetes;c__Bacteroidia;o__Bacteroidales;f__;g__

How should I write them? I've tried different things but with no good results!

Did you try something like this?

"o__Bacteroidales;f__S24-7"

Yes, I did. And this doesn't select anything.

when I try this group alone the error apearing confirms that.

qiime taxa filter-table
--i-table table-1.qza
--i-taxonomy TAXA/taxonomy-1.qza
--p-include "o__Bacteroidales;f__S24-7"
--o-filtered-table filtered_all_taxa_to_keep.qza

Plugin error from taxa:

All features were filtered, resulting in an empty table.

I don't know what can be happening!

I am not sure as well.
But there is a workaround:

Option 1. Visualize taxonomy file (as qzv) or export/extract a tsv file stored in taxonomy.qza. Get a list of ASV, assigned to desired taxa and use that list to filter the table.

Option 2. Export taxonomy as a tsv table, add substring to desired taxa, for example, "keep_me" at the end. Import it back as taxa_to_keep.qza. Use added substring and taxa_to_keep.qza to filter the table. In further analysis just use your original taxonomy.qza file.

Hi @timanix !
I realized that these features need to be written with a space between in order to be selected ("o__Bacteroidales; f__S24-7; g__;")

I was able to extract the desired ASVs from taxonomy.tsv.

Thanks a lot for your time :slight_smile: