Trouble renaming sample IDs with paired-end sequence data

Hi!
I had the same problem but I´m using paired-end sequences, I can´t change the sample IDs because it won´t create me the table.qza file. Is there another way to fix it?
Thanks!

Hi @malenaamer! In order for us to help you, please provide more details, such as the commands you’re running, the error messages you’re getting, and what file(s) you’re trying to rename the sample IDs in.

Great, thanks!
Here´s the results after trying to get the alpha analysis:

(qiime2-2017.2) MacBook-Pro-de-Malena-2:FirstHS mae$ qiime diversity alpha-group-significance --i-alpha-diversity cm1000/faith_pd_vector.qza --m-metadata-file sample-metadata.tsv --o-visualization cm1000/faith-pd-group-significance.qzv
Plugin error from diversity:

  index 10 is out of bounds for axis 1 with size 8

Re-run with --verbose to see debug info.
(qiime2-2017.2) MacBook-Pro-de-Malena-2:FirstHS mae$ qiime diversity alpha-group-significance --i-alpha-diversity cm45000/faith_pd_vector.qza --m-metadata-file sample-metadata.tsv --o-visualization cm45000/faith-pd-group-significance.qzv
Plugin error from diversity:

  index 10 is out of bounds for axis 1 with size 8

Re-run with --verbose to see debug info.
(qiime2-2017.2) MacBook-Pro-de-Malena-2:FirstHS mae$ qiime diversity alpha-group-significance --i-alpha-diversity cm45000/faith_pd_vector.qza --m-metadata-file sample-metadata.tsv --o-visualization cm45000/faith-pd-group-significance.qzv --verbose
Traceback (most recent call last):
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2-2017.2/lib/python3.5/site-packages/pandas/core/series.py", line 711, in _get_values
    return self._constructor(self._data.get_slice(indexer),
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2-2017.2/lib/python3.5/site-packages/pandas/core/internals.py", line 4135, in get_slice
    return self.__class__(self._block._slice(slobj),
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2-2017.2/lib/python3.5/site-packages/pandas/core/internals.py", line 252, in _slice
    return self.values[slicer]
IndexError: index 10 is out of bounds for axis 1 with size 8

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2-2017.2/lib/python3.5/site-packages/q2cli-2017.2.0-py3.5.egg/q2cli/commands.py", line 217, in __call__
    results = action(**arguments)
  File "<decorator-gen-162>", line 2, in alpha_group_significance
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2-2017.2/lib/python3.5/site-packages/qiime2-2017.2.0-py3.5.egg/qiime2/sdk/action.py", line 171, in callable_wrapper
    output_types, provenance)
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2-2017.2/lib/python3.5/site-packages/qiime2-2017.2.0-py3.5.egg/qiime2/sdk/action.py", line 305, in _callable_executor_
    ret_val = callable(output_dir=temp_dir, **view_args)
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2-2017.2/lib/python3.5/site-packages/q2_diversity-2017.2.0-py3.5.egg/q2_diversity/_alpha/_visualizer.py", line 46, in alpha_group_significance
    metadata_category = metadata_category[alpha_diversity.index]
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2-2017.2/lib/python3.5/site-packages/pandas/core/series.py", line 644, in __getitem__
    return self._get_with(key)
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2-2017.2/lib/python3.5/site-packages/pandas/core/series.py", line 678, in _get_with
    return self._get_values(key)
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2-2017.2/lib/python3.5/site-packages/pandas/core/series.py", line 714, in _get_values
    return self._values[indexer]
IndexError: index 10 is out of bounds for axis 1 with size 8

Plugin error from diversity:

  index 10 is out of bounds for axis 1 with size 8

See above for debug info.

sample-metadata copia.tsv (324 Bytes)

I also made a copy of the sample-metadata.tsv file for you.
Thanks for your help!

Thanks! As noted in the topic where you originally posted, you’ll need rename your sample IDs in the mapping file so they aren’t numbers, and start your analysis over with those new sample IDs.

I tried doing that and regenerate the table.qza file, but it gave me this error (here the sample-metadata was changed but the file name wasn’t):

(qiime2-2017.2) MacBook-Pro-de-Malena-2:FirstHS mae$ qiime feature-table summarize   --i-table table.qza   --o-visualization table.qzv   --m-sample-metadata-file sample-metadata.tsv
Plugin error from feature-table:

  "None of [Index(['3', '9', '10', '2', '4', '8', '7', '1'],
  dtype='object')] are in the [index]"

Re-run with --verbose to see debug info.
(qiime2-2017.2) MacBook-Pro-de-Malena-2:FirstHS mae$ qiime feature-table summarize   --i-table table.qza   --o-visualization table.qzv   --m-sample-metadata-file sample-metadata.tsv --verbose
Traceback (most recent call last):
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2-2017.2/lib/python3.5/site-packages/q2cli-2017.2.0-py3.5.egg/q2cli/commands.py", line 217, in __call__
    results = action(**arguments)
  File "<decorator-gen-202>", line 2, in summarize
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2-2017.2/lib/python3.5/site-packages/qiime2-2017.2.0-py3.5.egg/qiime2/sdk/action.py", line 171, in callable_wrapper
    output_types, provenance)
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2-2017.2/lib/python3.5/site-packages/qiime2-2017.2.0-py3.5.egg/qiime2/sdk/action.py", line 305, in _callable_executor_
    ret_val = callable(output_dir=temp_dir, **view_args)
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2-2017.2/lib/python3.5/site-packages/q2_feature_table-2017.2.0-py3.5.egg/q2_feature_table/_summarize/_visualizer.py", line 136, in summarize
    df.loc[sample_frequencies.index].to_json(fh)
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2-2017.2/lib/python3.5/site-packages/pandas/core/indexing.py", line 1312, in __getitem__
    return self._getitem_axis(key, axis=0)
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2-2017.2/lib/python3.5/site-packages/pandas/core/indexing.py", line 1472, in _getitem_axis
    return self._getitem_iterable(key, axis=axis)
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2-2017.2/lib/python3.5/site-packages/pandas/core/indexing.py", line 1036, in _getitem_iterable
    self._has_valid_type(key, axis)
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2-2017.2/lib/python3.5/site-packages/pandas/core/indexing.py", line 1395, in _has_valid_type
    (key, self.obj._get_axis_name(axis)))
KeyError: "None of [Index(['3', '9', '10', '2', '4', '8', '7', '1'], dtype='object')] are in the [index]"

Plugin error from feature-table:

  "None of [Index(['3', '9', '10', '2', '4', '8', '7', '1'],
  dtype='object')] are in the [index]"

See above for debug info.

Then I tried only running the alpha analysis without changing the table.qza (sample-metadata2 is the file with changed integer numbers (1s instead of 1) and it returned this:

(qiime2-2017.2) MacBook-Pro-de-Malena-2:FirstHS mae$ qiime diversity alpha-group-significance --i-alpha-diversity cm45000/evenness_vector.qza --m-metadata-file sample-metadata2.tsv --o-visualization cm45000/evenness-group-significance.qzv 
Plugin error from diversity:

  index 10 is out of bounds for axis 1 with size 8

Re-run with --verbose to see debug info.
(qiime2-2017.2) MacBook-Pro-de-Malena-2:FirstHS mae$ qiime diversity alpha-group-significance --i-alpha-diversity cm45000/evenness_vector.qza --m-metadata-file sample-metadata2.tsv --o-visualization cm45000/evenness-group-significance.qzv --verbose
Traceback (most recent call last):
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2-2017.2/lib/python3.5/site-packages/pandas/core/series.py", line 711, in _get_values
    return self._constructor(self._data.get_slice(indexer),
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2-2017.2/lib/python3.5/site-packages/pandas/core/internals.py", line 4135, in get_slice
    return self.__class__(self._block._slice(slobj),
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2-2017.2/lib/python3.5/site-packages/pandas/core/internals.py", line 252, in _slice
    return self.values[slicer]
IndexError: index 10 is out of bounds for axis 1 with size 8

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2-2017.2/lib/python3.5/site-packages/q2cli-2017.2.0-py3.5.egg/q2cli/commands.py", line 217, in __call__
    results = action(**arguments)
  File "<decorator-gen-162>", line 2, in alpha_group_significance
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2-2017.2/lib/python3.5/site-packages/qiime2-2017.2.0-py3.5.egg/qiime2/sdk/action.py", line 171, in callable_wrapper
    output_types, provenance)
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2-2017.2/lib/python3.5/site-packages/qiime2-2017.2.0-py3.5.egg/qiime2/sdk/action.py", line 305, in _callable_executor_
    ret_val = callable(output_dir=temp_dir, **view_args)
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2-2017.2/lib/python3.5/site-packages/q2_diversity-2017.2.0-py3.5.egg/q2_diversity/_alpha/_visualizer.py", line 46, in alpha_group_significance
    metadata_category = metadata_category[alpha_diversity.index]
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2-2017.2/lib/python3.5/site-packages/pandas/core/series.py", line 644, in __getitem__
    return self._get_with(key)
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2-2017.2/lib/python3.5/site-packages/pandas/core/series.py", line 678, in _get_with
    return self._get_values(key)
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2-2017.2/lib/python3.5/site-packages/pandas/core/series.py", line 714, in _get_values
    return self._values[indexer]
IndexError: index 10 is out of bounds for axis 1 with size 8

Plugin error from diversity:

  index 10 is out of bounds for axis 1 with size 8

See above for debug info.
(qiime2-2017.2) MacBook-Pro-de-Malena-2:FirstHS mae$ qiime diversity alpha-group-significance --i-alpha-diversity cm45000/evenness_vector.qza --m-metadata-file sample-metadata2.tsv --o-visualization cm45000/evenness-group-significance.qzv 
Plugin error from diversity:

  index 10 is out of bounds for axis 1 with size 8

Re-run with --verbose to see debug info.

Should I try something else?

Apologies for the delay in getting back to you. After renaming the sample IDs in your mapping file, you’ll need to regenerate your feature table (e.g. table.qza) since the table contains the old sample IDs. To do that, you may need to backtrack further in your analysis, likely to the demultiplexing step (e.g. qiime demux emp) or the Casava import step (if your reads are already demultiplexed) so that the new sample IDs are used in the data that’s generated by QIIME 2. Let us know how it goes!

2 Likes

Thanks!
I had to change the cassava format file names and redo it, it worked!

1 Like