Trailing Space Causing Error in Reading Metadata

Hi there,

I’m getting the following error when trying to run ‘feature-table summarize’ even though that sample is present in the metadata. The hang up appears to be the fact there is a space at the end of the sample ID. The error persists even when that space is included in the metadata, which suggests to me that the script that inputs the metadata ID is stripping trailing white-spaces at this step (which weren’t stripped from the same metadata at an earlier step).

I am unable to complete the command. Please advise,

Thanks!

ERROR CODE:
Plugin error from feature-table:

The following ID(s) are not present in the Metadata: 'Jl_NTR1 ’

ERROR LOG:

Traceback (most recent call last):
File “/home/roli/anaconda3/envs/qiime2-2018.2/lib/python3.5/site-packages/q2cli/commands.py”, line 246, in call
results = action(**arguments)
File “”, line 2, in summarize
File “/home/roli/anaconda3/envs/qiime2-2018.2/lib/python3.5/site-packages/qiime2/sdk/action.py”, line 228, in bound_callable
output_types, provenance)
File “/home/roli/anaconda3/envs/qiime2-2018.2/lib/python3.5/site-packages/qiime2/sdk/action.py”, line 424, in callable_executor
ret_val = self._callable(output_dir=temp_dir, **view_args)
File “/home/roli/anaconda3/envs/qiime2-2018.2/lib/python3.5/site-packages/q2_feature_table/_summarize/_visualizer.py”, line 148, in summarize
sample_frequencies.index)
File “/home/roli/anaconda3/envs/qiime2-2018.2/lib/python3.5/site-packages/qiime2/metadata/metadata.py”, line 489, in filter_ids
% (’, '.join(repr(e) for e in sorted(missing_ids))))
ValueError: The following ID(s) are not present in the Metadata: 'Jl_NTR1 ’

1 Like

Hi there @Roland_Wilhelm - what a pain in the butt, sorry to hear that. I have opened an issue to ensure that the IDs saved in methods generating a feature table provide IDs consistent with the Metadata ID spec.

In the meantime, I think you have a few options:

  • Start from scratch, specifying the spaceless version of the sample ID. This will depend on what import format you used in your initial steps. Clearly this could be a huge amount of time, depending on what your initial analysis looks like. I just mention this because it would probably be the easiest…
  • Export your feature table and use the BIOM CLI tool to relabel the sample ID
  • Run summarize without metadata - this doesn’t help if you were interested in metadata-based interactive rarefaction investigation.

Let us know if you have any other thoughts or questions - really sorry you got caught by this inconsistency on our end, let us know what we can do to help make it smooth for you. :t_rex:

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