RAREFIED TABLE-prior to assigning guilds

Hi Nicholas,

So I am having a problem running the codes and getting results. I have a collapsed table.qza (= taxonomy-table.qza), created the EcM-data.txt and ran the following code:

qiime taxa filter-table
--i-table taxonomy-table.qza \
--i-taxonomy taxonomy.qza
--p-query-delimiter EcM-data.txt \
--p-mode exact
--o-filtered-table EcM-table.qza
--verbose

Error
Traceback (most recent call last):
File "/home/qiime2/miniconda/envs/qiime2-2018.6/lib/python3.5/site-packages/q2cli/commands.py", line 274, in call
results = action(**arguments)
File "", line 2, in filter_table
File "/home/qiime2/miniconda/envs/qiime2-2018.6/lib/python3.5/site-packages/qiime2/sdk/action.py", line 232, in bound_callable
output_types, provenance)
File "/home/qiime2/miniconda/envs/qiime2-2018.6/lib/python3.5/site-packages/qiime2/sdk/action.py", line 367, in callable_executor
output_views = self._callable(**view_args)
File "/home/qiime2/miniconda/envs/qiime2-2018.6/lib/python3.5/site-packages/q2_taxa/_method.py", line 90, in filter_table
mode)
File "/home/qiime2/miniconda/envs/qiime2-2018.6/lib/python3.5/site-packages/q2_taxa/_method.py", line 35, in _ids_to_keep_from_taxonomy
raise ValueError("At least one filtering term must be provided.")
ValueError: At least one filtering term must be provided.

Plugin error from taxa:
** At least one filtering term must be provided.**
See above for debug info

Attached is the guild-metadata.tsv (215.2 KB) and the EcM-data.txt (21.3 KB)
in case you need to look at it.

If I manage to figure it out, by tomorrow (Sunday), I will update the message.

You're almost there! The issue is that you need to use either --p-include or --p-exclude — the contents of EcM-data.txt are what you want to pass to one of these parameters. You do not want to use the query-delimiter parameter (that parameter is just telling :qiime2: whether your taxa to include/exclude are separated by commas or another character. You are using commas (the default delimiter) so do not need to specify anything different)

So close, I actually tried that last night but I had left the delimeter parameter. Either way, I just ran the code as you said, and now I get this error.

image
(Followed by various lines of Taxonomy ID's)

I will check my table and make sure the ID's are the same, which I believe they are, as I had checked them before. Please let me know if you have any suggestions, in the meatime I will troubleshoot.

Thanks again

So I went ahead and looked at my guild-metadata.qza and taxonomy-table.qza and compared them to taxonomy.qza, and they all have the ID's present, with the exception of the ones that have ;; etc.

guild-metadata

taxonomy

It appears like all the taxonomy that contain those types of symbols on the metadata (;; etc) are not present in the taxonomy file, and if they are, they do not contain the symbols. Could this be the problem?

Bingo. The taxonomy only contains as many levels as could be confidently classified. Hence, you see ASVs classified to family level without the ";;" at the end. When you use taxa collapse or taxa barcode, you collapse at a specific level and the empty levels are appended to the end to "fill in" missing levels, so you get things like "...Mycosphaerellaceae;;".

So you are correct — just delete those empty levels from the end of your taxa names in EcM-data.txt and it should work.

Hi Nicholas,

Sorry to bug you again. I did as you said, removed all the _; from all the taxa names in EcM-data.txt and I still get the same error. I have attached the EcM-data.txt (21.1 KB)
file in case you want to take a look at it.

Is it the exact same error? Does it list all taxa in EcM-data.txt or just a few? Could you share the table and taxonomy?

Yes, the exact same error. The EcM taxa only contains a few of the taxa, I believe is the EcM only, but I will double check.

Here are the files requested
taxonomy.qza (351.7 KB)

EcM-data.txt (21.1 KB)
taxonomy-table.qza (240.0 KB)

Copy of error I received the second time around, sorry I didn't add it previously.

Followed by an extensive long list of taxa.
image

Hi @Fabs,
It looks like the feature table you are filtering is already collapsed. So that can be filtered using qiime feature-table filter-features using the EcM metadata file, but not qiime taxa filter-table. The latter has a non-collapsed feature table as input (the idea being that you can filter out any feature based on its taxonomy affiliation in taxonomy.qza, rather than filtering based on the feature ID… so you can retain the raw ASVs which is maybe better in this case).

Just to understand, which one do you think is better for me to use, the taxa filtering? If so, I will do that now, I somehow just thought that the ID on the table needed to match the metadata so I collapsed the table.

Sorry if I gave that impression somewhere above.

Yes, it does need to match for the metadata-based filtering in qiime feature-table filter-features.

No, it does not for qiime taxa filter-table because the taxonomy.qza file contains the taxonomy information that is used for assessing filtering criteria.

I'd suggest the latter (taxa filter-table) because you can work with the original ASVs if you want to (as opposed to only working on a collapsed table) and because you have already been working on that approach and you are so close!

It was my fault, I just assumed that to filter anything, the ID had to match so that qiime2 would pick it up.

So after running this code, I get the following error:

qiime taxa filter-table
–i-table table.qza
–i-taxonomy taxonomy.qza
–p-include EcM-data.txt
–p-mode exact
–o-filtered-table EcM-table.qza
–verbose

File “/home/qiime2/miniconda/envs/qiime2-2018.6/lib/python3.5/site-packages/q2cli/commands.py”, line 274, in call
results = action(**arguments)
File “”, line 2, in filter_table
File “/home/qiime2/miniconda/envs/qiime2-2018.6/lib/python3.5/site-packages/qiime2/sdk/action.py”, line 232, in bound_callable
output_types, provenance)
File “/home/qiime2/miniconda/envs/qiime2-2018.6/lib/python3.5/site-packages/qiime2/sdk/action.py”, line 367, in callable_executor
output_views = self._callable(**view_args)
File “/home/qiime2/miniconda/envs/qiime2-2018.6/lib/python3.5/site-packages/q2_taxa/_method.py”, line 93, in filter_table
raise ValueError("All features were filtered, resulting in an "
ValueError: All features were filtered, resulting in an empty table.

Plugin error from taxa:
** All features were filtered, resulting in an empty table.**
See above for debug info.

I will do some research in the meantime and see if I can figure it out before you get back to me.

So after looking online to try to figure out what is going on I decided to try qiime feature-table filter-features. Using this method worked, but if you could still tell me how to get the taxa filter-table, that would be great.

I do have an additional question for you, not sure if I should ask here, or create another string.

I will do the diversity metrics on the new table, and realized that I use the same rep-seqs.qza file created by DADA2 which is used for the phylogeny tree and downstream metrics. I saw your post here, which seems as if the unwanted samples will be dropped from the analysis, is this correct? If not, do I also have to filter the rep-seqs.qza prior to running phylogeny tree?

Glad to hear you found a filtering method that works for you!

I think the command you are using above should work, except that you need to use the feature table that has NOT been collapsed on taxonomy (i.e., the feature IDs should match the feature IDs in taxonomy.qza)

please open a new topic for that question — I will gladly answer, but the new topic makes it easier for other readers to find questions similar to their own! Thanks :grin:

I actually figured it out based on one of your previous post. thanks :slight_smile:

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