Error with feature-table filter-seqs: All features were filtered out of the data.

Dear all,

I was trying to run the following command:

qiime feature-table filter-seqs \
  --i-data allBatches-representativeSeqs.qza \
  --m-metadata-file metadata_allBatches_full.tsv \
  --p-where "organ_blank IN ('lung', 'blank')" \
  --o-filtered-data lungBlank_allBatches-repSeqs.qza

However, I was unable due to an error. Does anyone have an idea of what might be going on?
I know that this would not filter all samples out as organ_blank can take other values.

The error message is:
Traceback (most recent call last):
File “/home/pcadmin/miniconda3/envs/qiime2-2019.1/lib/python3.6/site-packages/q2cli/commands.py”, line 274, in call
results = action(**arguments)
File “</home/pcadmin/miniconda3/envs/qiime2-2019.1/lib/python3.6/site-packages/decorator.py:decorator-gen-318>”, line 2, in filter_seqs
File “/home/pcadmin/miniconda3/envs/qiime2-2019.1/lib/python3.6/site-packages/qiime2/sdk/action.py”, line 231, in bound_callable
output_types, provenance)
File “/home/pcadmin/miniconda3/envs/qiime2-2019.1/lib/python3.6/site-packages/qiime2/sdk/action.py”, line 365, in callable_executor
output_views = self._callable(**view_args)
File “/home/pcadmin/miniconda3/envs/qiime2-2019.1/lib/python3.6/site-packages/q2_feature_table/_filter.py”, line 112, in filter_seqs
raise ValueError(‘All features were filtered out of the data.’)
ValueError: All features were filtered out of the data.

Plugin error from feature-table:

  All features were filtered out of the data.

See above for debug info.

Welcome to the forum, @Ricardo_Ramiro!
My first thought is that this may be a punctuation/syntax issue in --p-where. Do the suggestions/docs linked here help?

If your --p-where query still isn't working after you've tried again, feel free to DM me your feature table and metadata - I can give it a shot.

:sun_with_face:
Chris

1 Like

At second glance, @Ricardo_Ramiro, it looks like you have an ID mismatch here - your command is trying to filter the features in your rep-seqs using the sample ids from your metadata file. Your sample and feature IDs are different, so the query finds no matches.

Try using your --p-where query to filter samples from your FeatureTable[Frequency].

Filtering out the samples that match your query will produce a FeatureTable[frequency] file you can then pass into filter-seqs without a --p-where query. Features that exist in your filtered table will be retained, features that don’t exist in those samples will be dropped.

Lots of good information on filtering in the Filtering Data Tutorial

Hope this helps!
Chris

4 Likes

Hi Chris,

Thanks a lot for your help. I was able to get to the solution, which was simply

  qiime feature-table filter-seqs \
  --i-data rep-seqs.qza \
  --i-table clean-table.qza \
  --o-filtered-data clean-rep-seqs.qza

I am leaving it here for future reference, as I think this sort of filtering must be very common and I could not see it in the filtering tutorial.

Best,

Ramiro

9 Likes

An off-topic reply has been split into a new topic: why are my 16S data dominated by eukaryotes?

Please keep replies on-topic in the future.

Finally worked for me! Have been trying for a while with metadata (as works with the ‘table.qza’). Using the filtered table instead works!!
Thanks, -JA