Ancom Composition "IDs_to_keep" error


Here is my code:

qiime composition ancom --i-table comptypetable.qza --m-metadata-file MetadataYC.txt --m-metadata-column Number --o-visualization ancomnumber.qzv

Number is a categorical column (believe it or not) and everything has worked well to this point. The error I am receiving is:
Plugin error from composition:

ids_to_keep must contain at least one ID.

What am I doing wrong? There are no blanks, the metadata file checked out so far…

1 Like

Hi @Kmf,
Could you please post the full error message? Either use the --verbose flag in your command to see the full error, or read the error log that is given with the error summary.


Traceback (most recent call last):
File “/Users/parksh/miniconda3/envs/qiime2-2018.8/lib/python3.5/site-packages/q2cli/”, line 274, in call
results = action(**arguments)
File “”, line 2, in ancom
File “/Users/parksh/miniconda3/envs/qiime2-2018.8/lib/python3.5/site-packages/qiime2/sdk/”, line 231, in bound_callable
output_types, provenance)
File “/Users/parksh/miniconda3/envs/qiime2-2018.8/lib/python3.5/site-packages/qiime2/sdk/”, line 424, in callable_executor
ret_val = self._callable(output_dir=temp_dir, **view_args)
File “/Users/parksh/miniconda3/envs/qiime2-2018.8/lib/python3.5/site-packages/q2_composition/”, line 46, in ancom
metadata = metadata.filter_ids(table.index)
File “/Users/parksh/miniconda3/envs/qiime2-2018.8/lib/python3.5/site-packages/qiime2/metadata/”, line 1102, in filter_ids
File “/Users/parksh/miniconda3/envs/qiime2-2018.8/lib/python3.5/site-packages/qiime2/metadata/”, line 189, 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 composition:

ids_to_keep must contain at least one ID.

See above for debug info.

Thanks @Kmf!

Judging from this error, it would seem that comptypetable.qza is either empty, or has different sample IDs from those in MetadataYC.txt. Did you filter or collapse your feature table at any point by any chance?

You can use qiime feature-table summarize to check the sample IDs present in the feature table and make sure they match those in the metadata file.

If that does not reveal the problem, could you please share:

  1. the feature table summary
  2. the feature table
  3. the metadata file

You can send those directly to me in a DM if you don’t want those files to be visible for everyone to see here! :floppy_disk: :eyes: :earth_americas:

Hi @Kmf

Thank you for sending the data files.

Indeed, the feature table was empty. It looks like the filtering command that you used filtered out all samples. You should revisit the filtering step, and make sure that the --p-where parameter is used correctly and specifies one or more valid metadata values.

I hope that helps!

Thank you for the information and kind help today sir! =)

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