# qiime2 :Plugin error from feature-table: list index out of range

**URL:** https://forum.qiime2.org/t/qiime2-plugin-error-from-feature-table-list-index-out-of-range/14285
**Category:** Technical Support
**Tags:** import, feature-table
**Created:** [March 31, 2020, 12:19pm UTC](https://forum.qiime2.org/t/qiime2-plugin-error-from-feature-table-list-index-out-of-range/14285 "2020-03-31T12:19:24Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![whl](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/w/8dc957/32.png) [@whl](https://forum.qiime2.org/u/whl)
#### Post date: [March 31, 2020, 12:19pm UTC](https://forum.qiime2.org/t/qiime2-plugin-error-from-feature-table-list-index-out-of-range/14285/1 "2020-03-31T12:19:24Z")

</div>

Hi, I am a new qiime2 user, i met an error when i conducted following code: qiime feature-table summarize  
--i-table table.qza --o-visualization table.qzv  
--m-sample-metadata-file metadatadeep.tsv  
the error is:  
Plugin error from feature-table:  
list index out of range  
i thought my metadatafile had some mistake, however ,i could succeffully run :  
qiime taxa barplot  
--i-table table.qza  
--i-taxonomy taxonomy.qza  
--m-metadata-file metadatadeep.tsv  
--o-visualization taxa-bar-plots.qzv  
so i am very confused, someone could help me? thanks a lot!!!  
The delog file:  
/home/wanghuilin/miniconda3/envs/qiime2/lib/python3.6/site-packages/q2\_feature\_table/\_summarize/\_visualizer.py:122: FutureWarning: The signature of `Series.to_csv` was aligned to that of `DataFrame.to_csv`, and argument 'header' will change its default value from False to True: please pass an explicit value to suppress this warning.  
os.path.join(output\_dir, 'sample-frequency-detail.csv'))  
/home/wanghuilin/miniconda3/envs/qiime2/lib/python3.6/site-packages/q2\_feature\_table/\_summarize/\_visualizer.py:124: FutureWarning: The signature of `Series.to_csv` was aligned to that of `DataFrame.to_csv`, and argument 'header' will change its default value from False to True: please pass an explicit value to suppress this warning.  
os.path.join(output\_dir, 'feature-frequency-detail.csv'))  
Traceback (most recent call last):  
File "/home/wanghuilin/miniconda3/envs/qiime2/lib/python3.6/site-packages/q2cli/commands.py", line 328, in **call**  
results = action(\*\*arguments)  
File "\</home/wanghuilin/miniconda3/envs/qiime2/lib/python3.6/site-packages/decorator.py:decorator-gen-326\>", line 2, in summarize  
File "/home/wanghuilin/miniconda3/envs/qiime2/lib/python3.6/site-packages/qiime2/sdk/action.py", line 245, in bound\_callable  
output\_types, provenance)  
File "/home/wanghuilin/miniconda3/envs/qiime2/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 "/home/wanghuilin/miniconda3/envs/qiime2/lib/python3.6/site-packages/q2\_feature\_table/\_summarize/\_visualizer.py", line 156, in summarize  
sample\_frequencies  
File "/home/wanghuilin/miniconda3/envs/qiime2/lib/python3.6/site-packages/q2\_feature\_table/\_summarize/\_vega\_spec.py", line 106, in vega\_spec  
'value': metadata\_categories[0]  
IndexError: list index out of range

---

<div class="post-metadata">

### Author: ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)
#### Post date: [March 31, 2020, 2:19pm UTC](https://forum.qiime2.org/t/qiime2-plugin-error-from-feature-table-list-index-out-of-range/14285/2 "2020-03-31T14:19:50Z")

</div>

The error implies that your metadata has no metadata columns in it - can you please share your metadata file? You can send me a download link in a direct message if you don't want to share on this topic thread. Thanks!

---

<div class="post-metadata">

### Author: ![whl](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/w/8dc957/32.png) [@whl](https://forum.qiime2.org/u/whl)
#### Post date: [April 1, 2020, 3:26am UTC](https://forum.qiime2.org/t/qiime2-plugin-error-from-feature-table-list-index-out-of-range/14285/3 "2020-04-01T03:26:42Z")

</div>

Thank you for you reply. Here is my metadata file.[metadatadeep.tsv](https://forum.qiime2.org/uploads/short-url/65lMHRsLgU7SD4EpaSgyivGaZi9.tsv) (43 Bytes)  
The file only contains ID column.

---

<div class="post-metadata">

### Author: ![fedarko](https://forum.qiime2.org/user_avatar/forum.qiime2.org/fedarko/32/5361_2.png) [@fedarko](https://forum.qiime2.org/u/fedarko)
#### Post date: [April 1, 2020, 6:11am UTC](https://forum.qiime2.org/t/qiime2-plugin-error-from-feature-table-list-index-out-of-range/14285/4 "2020-04-01T06:11:08Z")

</div>

Hi @whl! The problem seems to be due to the definition of "column" -- the `qiime feature-table summarize` visualizer requires that your metadata file has **at least one column besides the ID column** , because it uses this other column as a default value when creating a visualization. **Long story short: if you add in another column to your metadata file in addition to the ID column, I bet `summarize` will work.** (You could even just add another column named `sample-id-2` or something that is identical to the first column and it should still work, but I'd recommend adding a more meaningful column if possible.)

In general, having a metadata file that contains only the sample IDs will cause you problems (_edit: although it is technically allowed by QIIME 2, see [here](https://docs.qiime2.org/2020.2/tutorials/metadata/#metadata-columns)_). Many programs will assume that your metadata has at least two columns -- they'll use the first column, which contains sample IDs, as the "index" of the metadata, and then consider all of the other columns as the only "columns" in the metadata file. This makes sense, since the first column in a metadata file doesn't actually contain any "metadata" -- it doesn't tell us anything new about the samples, **since the sample IDs are already present in the feature table**. So I'm guessing you'll likely run into this type of error with at least a few other QIIME 2 plugins, or with other software tools. (Also, the more information you have in your metadata file, the easier it will be to visualize and analyze your data!)

The reason `qiime taxa barplot` worked for you is that that visualizer doesn't directly try to look at any of the metadata columns -- instead, it just tries to "merge" the metadata, including the ID column, into the table. (If you're interested, the Python code where this is done is [here](https://github.com/qiime2/q2-taxa/blob/7159f1fea44f5570a0280cb7cfd26f851957bad4/q2_taxa/_visualizer.py#L40). 🐍) Since this doesn't assume that the metadata file has other columns, it works with metadata files that only have the ID column -- but I don't think this is an assumption you can make safely with other programs.

Let us know if adding another column to your metadata file solves this problem! :qiime2:

---

<div class="post-metadata">

### Author: ![whl](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/w/8dc957/32.png) [@whl](https://forum.qiime2.org/u/whl)
#### Post date: [April 1, 2020, 11:29am UTC](https://forum.qiime2.org/t/qiime2-plugin-error-from-feature-table-list-index-out-of-range/14285/5 "2020-04-01T11:29:13Z")

</div>

I shall say your advice is perfectly correct！It worked. Thank you very much for your help！
