I have this error: Plugin error from feature-table:
ids_to_keep must contain at least one ID.
I believe the problem may be that my unique IDs for column 1 of the metadata are called “id” and the feature-table IDs are something else.
However, I am not sure how to visualize the feature-table in order to see the IDs to confirm this suspicion.
I am working with AGP data and my code that resulted in the error is:
(qiime2-2021.2) katiemiriam@Katharines-MBP querying_redbiom % qiime feature-table summarize --i-table filtered-table-AGP.qza --o-visualization filtered-table.qzv --m-sample-metadata-file ./metadataR.tsv --verbose
Traceback (most recent call last):
File "/Users/katiemiriam/miniconda3/envs/qiime2-2021.2/lib/python3.6/site-packages/q2cli/commands.py", line 329, in __call__
results = action(**arguments)
File "<decorator-gen-342>", line 2, in summarize
File "/Users/katiemiriam/miniconda3/envs/qiime2-2021.2/lib/python3.6/site-packages/qiime2/sdk/action.py", line 245, in bound_callable
output_types, provenance)
File "/Users/katiemiriam/miniconda3/envs/qiime2-2021.2/lib/python3.6/site-packages/qiime2/sdk/action.py", line 452, in _callable_executor_
ret_val = self._callable(output_dir=temp_dir, **view_args)
File "/Users/katiemiriam/miniconda3/envs/qiime2-2021.2/lib/python3.6/site-packages/q2_feature_table/_summarize/_visualizer.py", line 156, in summarize
sample_frequencies
File "/Users/katiemiriam/miniconda3/envs/qiime2-2021.2/lib/python3.6/site-packages/q2_feature_table/_summarize/_vega_spec.py", line 16, in vega_spec
sample_frequencies.index)
File "/Users/katiemiriam/miniconda3/envs/qiime2-2021.2/lib/python3.6/site-packages/qiime2/metadata/metadata.py", line 728, in filter_ids
ids_to_keep)
File "/Users/katiemiriam/miniconda3/envs/qiime2-2021.2/lib/python3.6/site-packages/qiime2/metadata/metadata.py", line 184, in _filter_ids_helper
raise ValueError("`ids_to_keep` must contain at least one ID.")
ValueError: `ids_to_keep` must contain at least one ID.
Plugin error from feature-table:
`ids_to_keep` must contain at least one ID.
See above for debug info.
The index column name shouldn't matter - the error message is telling us that it found no valid IDs, although I'm not sure in which file. Please run the following and report back your findings:
Thanks, @thermokarst!
When I run: qiime tools inspect-metadata ./metadataR.tsv
I get a column listing all variables except "id" and a second column listing the type of each variable. There are 3560 IDs and 57 columns.
When I run: qiime tools inspect-metadata filtered-table-AGP.qza
it says: An error has been encountered:
Metadata must contain at least one ID.
When I view the metadataR.tsv file, the first column is ID, though. I'll attach that file here...metadataR.tsv (2.8 MB)
Perfect, thanks @watson! Your metadata file appears to be fine ! Unfortunately, your feature table has zero samples in it (uh oh!). You can further debug by running the summarize command sans metadata:
(qiime2-2021.2) katiemiriam@Katharines-MBP querying_redbiom % qiime feature-table filter-samples --i-table feature-table-AGP.qza --p-min-frequency 1000 --o-filtered-table sample-frequency-filtered-table-AGP.qza
Saved FeatureTable[Frequency] to: sample-frequency-filtered-table-AGP.qza
qiime feature-table filter-features --i-table sample-frequency-filtered-table-AGP.qza --p-min-frequency 3 --o-filtered-table feature-filtered-table-AGP.qza
Saved FeatureTable[Frequency] to: feature-filtered-table-AGP.qza
qiime feature-table filter-samples --i-table feature-filtered-table-AGP.qza --m-metadata-file ./metadataR.tsv --o-filtered-table filtered-table-AGP.qza
Saved FeatureTable[Frequency] to: filtered-table-AGP.qza
qiime feature-table summarize --i-table filtered-table-AGP.qza --o-visualization filtered-table.qzv --m-sample-metadata-file ./metadataR.tsv
**Plugin error from feature-table:**
**`ids_to_keep` must contain at least one ID.**
So, perhaps I have done something with the samples in these steps or there is something wrong with the data.biom file (although I thought I followed all the redbiom steps correctly)?
Sounds like you have everything you need to start diagnosing this issue - it looks like you applied at least 3 separate filtering steps - time to work your way backwards and see which step is responsible for clearing out your table. You can use the feature-table summarize command, sans metadata to help with this.
An update…the sample-frequency-filtered-table-AGP.qza indeed does not contain identifiers. It looks like when the data were downloaded using redbiom, sample identifiers were not attached to the sequences. Once I can figure out how to get those identifiers back and attach them to the sequences , it should work.