Alpha rarefaction plugin error

Hi,
When running, ‘qiime diversity alpha-rarefaction’ I get the following error when I pass this command along with my metadata file:

'Plugin error from diversity:

‘labels [‘std’ ‘mean’] not contained in axis’

I’ve checked my metadata with Keemei and all is well, any thoughts?

Thanks
–L

Hi @Lorinda! In order for us to help you, can you please provide the following:

  1. What version of QIIME 2 are you using?
  2. What was the exact command you ran (copy-and-paste)?
  3. What was the complete error you saw (copy and paste the --verbose output, or attach the log file)?
  4. Can you provide a sample of your metadata file?

Thanks! :t_rex:

Yes, here you go @thermokarst :

1. System versions
Python version: 3.5.4
QIIME 2 release: 2017.8
QIIME 2 version: 2017.8.0
q2cli version: 2017.8.0

2. Command:
qiime diversity alpha-rarefaction
--i-table table-NoContams.qza
--p-max-depth 1000
--m-metadata-file metadata-ASSP-Gradient-Foliar.txt
--o-visualization Rarefaction-Curve

  • I tried multiple sampling depths

3. Log File
Traceback (most recent call last):
File "/Users/lbullington/miniconda3/envs/qiime2-2017.8/lib/python3.5/site-packages/q2cli/commands.py", line 222, in call
results = action(**arguments)
File "", line 2, in alpha_rarefaction
File "/Users/lbullington/miniconda3/envs/qiime2-2017.8/lib/python3.5/site-packages/qiime2/sdk/action.py", line 201, in callable_wrapper
output_types, provenance)
File "/Users/lbullington/miniconda3/envs/qiime2-2017.8/lib/python3.5/site-packages/qiime2/sdk/action.py", line 392, in callable_executor
ret_val = callable(output_dir=temp_dir, **view_args)
File "/Users/lbullington/miniconda3/envs/qiime2-2017.8/lib/python3.5/site-packages/q2_diversity/_alpha/_visualizer.py", line 326, in alpha_rarefaction
c_df = _compute_summary(reindexed_df, category, counts=counts)
File "/Users/lbullington/miniconda3/envs/qiime2-2017.8/lib/python3.5/site-packages/q2_diversity/_alpha/_visualizer.py", line 219, in _compute_summary
summary_df.drop(['std', 'mean'], axis=1, inplace=True)
File "/Users/lbullington/miniconda3/envs/qiime2-2017.8/lib/python3.5/site-packages/pandas/core/generic.py", line 2161, in drop
new_axis = axis.drop(labels, errors=errors)
File "/Users/lbullington/miniconda3/envs/qiime2-2017.8/lib/python3.5/site-packages/pandas/core/indexes/base.py", line 3624, in drop
labels[mask])
ValueError: labels ['std' 'mean'] not contained in axis

4. Metadata Sample

1 Like

Wow! Thanks for the great followup @Lorinda! Something certainly seems a bit :fish:y here on the QIIME 2 side of things.

Can I ask for a few more pieces on information?

  • The output from the command conda list, when run in an activate QIIME 2 conda environment
  • The output from the command pip freeze, when run in an activate QIIME 2 conda environment

I am wondering if you have a different version of pandas somehow installed in this environment (or really any other third-party dependency). Thanks!

@thermokarst, thanks for your time! I hope this helps, its a bit over my head at this point…

Output from conda list:

# packages in environment at /Users/lbullington/miniconda3/envs/qiime2-2017.8:
#
appnope                   0.1.0                    py35_0  
bioconductor-biobase      2.34.0                 r3.3.1_0    bioconda
bioconductor-biocgenerics 0.20.0                 r3.3.1_0    bioconda
bioconductor-biocparallel 1.6.6                  r3.3.1_0    bioconda
bioconductor-biostrings   2.42.1                 r3.3.1_0    bioconda
bioconductor-dada2        1.4.0                  r3.3.1_0    bioconda
bioconductor-genomeinfodb 1.10.3                 r3.3.1_0    bioconda
bioconductor-genomicalignments 1.8.4                  r3.3.1_0    bioconda
bioconductor-genomicranges 1.26.4                 r3.3.1_0    bioconda
bioconductor-iranges      2.8.2                  r3.3.1_0    bioconda
bioconductor-rsamtools    1.24.0                 r3.3.1_0    bioconda
bioconductor-s4vectors    0.12.2                 r3.3.1_0    bioconda
bioconductor-shortread    1.32.0                 r3.3.1_0    bioconda
bioconductor-summarizedexperiment 1.2.3                  r3.3.1_0    bioconda
bioconductor-xvector      0.14.1                 r3.3.1_0    bioconda
bioconductor-zlibbioc     1.20.0                 r3.3.1_0    bioconda
biom-format               2.1.5                    py35_3    qiime2
bkcharts                  0.2                      py35_0  
blast                     2.6.0               boost1.61_1    bioconda
bleach                    1.5.0                    py35_0  
bokeh                     0.12.7                   py35_0  
cachecontrol              0.12.3                   py35_0  
click                     6.7                      py35_0  
curl                      7.54.1                        0  
cycler                    0.10.0                   py35_0  
deblur                    1.0.2                    py35_0    biocore
decorator                 4.1.2                    py35_0  
emperor                   1.0.0beta8               py35_2    conda-forge
entrypoints               0.2.3                    py35_0  
fastcluster               1.1.23              np113py35_0    conda-forge
fasttree                  2.1.9                         2    bioconda
freetype                  2.5.5                         2  
future                    0.16.0                   py35_1  
gneiss                    0.4.1            py35ha7bfd4e_6    biocore
gsl                       2.2.1                         0  
h5py                      2.7.0               np113py35_0  
hdf5                      1.8.17                        2  
html5lib                  0.9999999                py35_0  
icu                       54.1                          0  
ijson                     2.3                      py35_0    qiime2
ipykernel                 4.6.1                    py35_0  
ipython                   6.1.0                    py35_0  
ipython_genutils          0.2.0                    py35_0  
ipywidgets                6.0.0                    py35_0  
jbig                      2.1                           0  
jedi                      0.10.2                   py35_2  
jinja2                    2.9.6                    py35_0  
jpeg                      9b                            0  
jsonschema                2.6.0                    py35_0  
jupyter_client            5.1.0                    py35_0  
jupyter_core              4.3.0                    py35_0  
krb5                      1.13.2                        0  
libgcc                    4.8.5                         1  
libiconv                  1.14                          0  
libpng                    1.6.30                        1  
libssh2                   1.8.0                         0  
libtiff                   4.0.6                         3  
libxml2                   2.9.4                         0  
lockfile                  0.12.2                   py35_0  
mafft                     7.221                         0    bioconda
markupsafe                1.0                      py35_0  
matplotlib                2.0.2               np113py35_0  
mistune                   0.7.4                    py35_0  
mkl                       2017.0.3                      0  
msgpack-python            0.4.8                    py35_0  
natsort                   5.1.0                    py35_0  
nbconvert                 5.2.1                    py35_0  
nbformat                  4.4.0                    py35_0  
ncurses                   5.9                          10  
nose                      1.3.7                    py35_1  
notebook                  5.0.0                    py35_0  
numpy                     1.13.1                   py35_0  
openssl                   1.0.2l                        0  
pandas                    0.20.3                   py35_0  
pandocfilters             1.4.2                    py35_0  
path.py                   10.3.1                   py35_0  
patsy                     0.4.1                    py35_0  
pcre                      8.39                          1  
pexpect                   4.2.1                    py35_0  
pickleshare               0.7.4                    py35_0  
pip                       9.0.1                    py35_1  
prompt_toolkit            1.0.15                   py35_0  
psutil                    5.2.2                    py35_0  
ptyprocess                0.5.2                    py35_0  
pygments                  2.2.0                    py35_0  
pyparsing                 2.2.0                    py35_0  
pyqt                      5.6.0                    py35_2  
python                    3.5.4                         0  
python-dateutil           2.6.1                    py35_0  
pytz                      2017.2                   py35_0  
pyyaml                    3.12                     py35_0  
pyzmq                     16.0.2                   py35_0  
q2-alignment              2017.8.0                 py35_0    qiime2/label/r2017.8
q2-composition            2017.8.0                 py35_0    qiime2/label/r2017.8
q2-dada2                  2017.8.0                 py35_0    qiime2/label/r2017.8
q2-deblur                 2017.8.0                 py35_0    qiime2/label/r2017.8
q2-demux                  2017.8.0                 py35_0    qiime2/label/r2017.8
q2-diversity              2017.8.0                 py35_0    qiime2/label/r2017.8
q2-emperor                2017.8.0                 py35_0    qiime2/label/r2017.8
q2-feature-classifier     2017.8.0                 py35_0    qiime2/label/r2017.8
q2-feature-table          2017.8.0                 py35_0    qiime2/label/r2017.8
q2-gneiss                 2017.8.0                 py35_0    qiime2/label/r2017.8
q2-longitudinal           2017.8.0                 py35_0    qiime2/label/r2017.8
q2-metadata               2017.8.0                 py35_0    qiime2/label/r2017.8
q2-phylogeny              2017.8.0                 py35_0    qiime2/label/r2017.8
q2-quality-filter         2017.8.0                 py35_0    qiime2/label/r2017.8
q2-sample-classifier      2017.8.0                 py35_0    qiime2/label/r2017.8
q2-taxa                   2017.8.0                 py35_0    qiime2/label/r2017.8
q2-types                  2017.8.0                 py35_0    qiime2/label/r2017.8
q2cli                     2017.8.0                 py35_0    qiime2/label/r2017.8
q2templates               2017.8.0                 py35_0    qiime2/label/r2017.8
qiime2                    2017.8.0                 py35_0    qiime2/label/r2017.8
qt                        5.6.2                         2  
r                         3.3.1                  r3.3.1_0  
r-base                    3.3.1                         0  
r-bh                      1.60.0_2               r3.3.1_0  
r-bitops                  1.0_6                  r3.3.1_2  
r-boot                    1.3_18                 r3.3.1_0  
r-chron                   2.3_47                 r3.3.1_0  
r-class                   7.3_14                 r3.3.1_0  
r-cluster                 2.0.4                  r3.3.1_0  
r-codetools               0.2_14                 r3.3.1_0  
r-colorspace              1.2_6                  r3.3.1_0  
r-data.table              1.9.6                  r3.3.1_0  
r-dichromat               2.0_0                  r3.3.1_2  
r-digest                  0.6.9                  r3.3.1_0  
r-foreign                 0.8_66                 r3.3.1_0  
r-futile.logger           1.4.1                  r3.3.1_0    bioconda
r-futile.options          1.0.0                  r3.3.1_0    bioconda
r-ggplot2                 2.1.0                  r3.3.1_0  
r-gtable                  0.2.0                  r3.3.1_0  
r-hwriter                 1.3.2                  r3.3.1_0    bioconda
r-kernsmooth              2.23_15                r3.3.1_0  
r-labeling                0.3                    r3.3.1_2  
r-lambda.r                1.1.7                  r3.3.1_0    bioconda
r-lattice                 0.20_33                r3.3.1_0  
r-latticeextra            0.6_28                 r3.3.1_0  
r-magrittr                1.5                    r3.3.1_2  
r-mass                    7.3_45                 r3.3.1_0  
r-matrix                  1.2_6                  r3.3.1_0  
r-mgcv                    1.8_12                 r3.3.1_0  
r-munsell                 0.4.3                  r3.3.1_0  
r-nlme                    3.1_128                r3.3.1_0  
r-nnet                    7.3_12                 r3.3.1_0  
r-plyr                    1.8.4                  r3.3.1_0  
r-rcolorbrewer            1.1_2                  r3.3.1_3  
r-rcpp                    0.12.5                 r3.3.1_0  
r-rcppparallel            4.3.20                 r3.3.1_1    bioconda
r-rcurl                   1.95_4.8               r3.3.1_0  
r-recommended             3.3.1                  r3.3.1_0  
r-reshape2                1.4.1                        1a  
r-rpart                   4.1_10                 r3.3.1_0  
r-scales                  0.4.0                  r3.3.1_0  
r-snow                    0.4_1                  r3.3.1_0    bioconda
r-spatial                 7.3_11                 r3.3.1_0  
r-stringi                 1.1.1                  r3.3.1_0  
r-stringr                 1.0.0                  r3.3.1_0  
r-survival                2.39_4                 r3.3.1_0  
readline                  6.2                           2  
requests                  2.14.2                   py35_0  
scikit-bio                0.5.1               np113py35_0  
scikit-learn              0.19.0              np113py35_0  
scipy                     0.19.1              np113py35_0  
seaborn                   0.8                      py35_0  
setuptools                27.2.0                   py35_0  
simplegeneric             0.8.1                    py35_1  
sip                       4.18                     py35_0  
six                       1.10.0                   py35_0  
sortmerna                 2.0                           1    bioconda
sqlite                    3.13.0                        0  
statsmodels               0.8.0               np113py35_0  
terminado                 0.6                      py35_0  
testpath                  0.3.1                    py35_0  
tk                        8.5.18                        0  
tornado                   4.5.2                    py35_0  
traitlets                 4.3.2                    py35_0  
tzlocal                   1.3                      py35_0    qiime2
vsearch                   2.0.3                         1    bioconda
wcwidth                   0.1.7                    py35_0  
wheel                     0.29.0                   py35_0  
widgetsnbextension        3.0.2                    py35_0  
xz                        5.2.3                         0  
yaml                      0.1.6                         0  
zlib                      1.2.11                        0  

Output from pip freeze:

appnope==0.1.0
biom-format==2.1.5
bkcharts==0.2
bleach==1.5.0
bokeh==0.12.7
CacheControl==0.12.3
click==6.7
cycler==0.10.0
deblur==1.0.2
decorator==4.1.2
emperor==1.0.0b8
entrypoints==0.2.3
fastcluster==1.1.23
future==0.16.0
gneiss==0.4.1
h5py==2.7.0
html5lib==0.9999999
ijson==2.3
ipykernel==4.6.1
ipython==6.1.0
ipython-genutils==0.2.0
ipywidgets==6.0.0
jedi==0.10.2
Jinja2==2.9.6
jsonschema==2.6.0
jupyter-client==5.1.0
jupyter-core==4.3.0
lockfile==0.12.2
MarkupSafe==1.0
matplotlib==2.0.2
mistune==0.7.4
msgpack-python==0.4.8
natsort==5.1.0
nbconvert==5.2.1
nbformat==4.4.0
nose==1.3.7
notebook==5.0.0
numpy==1.13.1
pandas==0.20.3
pandocfilters==1.4.2
patsy==0.4.1
pexpect==4.2.1
pickleshare==0.7.4
prompt-toolkit==1.0.15
psutil==5.2.2
ptyprocess==0.5.2
Pygments==2.2.0
pyparsing==2.2.0
python-dateutil==2.6.1
pytz==2017.2
PyYAML==3.12
pyzmq==16.0.2
q2-alignment==2017.8.0
q2-composition==2017.8.0
q2-dada2==2017.8.0
q2-deblur==2017.8.0
q2-demux==2017.8.0
q2-diversity==2017.8.0
q2-emperor==2017.8.0
q2-feature-classifier==2017.8.0
q2-feature-table==2017.8.0
q2-gneiss==2017.8.0
q2-longitudinal==2017.8.0
q2-metadata==2017.8.0
q2-phylogeny==2017.8.0
q2-quality-filter==2017.8.0
q2-sample-classifier==2017.8.0
q2-taxa==2017.8.0
q2-types==2017.8.0
q2cli==2017.8.0
q2templates==2017.8.0
qiime2==2017.8.0
requests==2.14.2
scikit-bio==0.5.1
scikit-learn==0.19.0
scipy==0.19.1
seaborn==0.8
simplegeneric==0.8.1
six==1.10.0
statsmodels==0.8.0
terminado==0.6
testpath==0.3
tornado==4.5.2
traitlets==4.3.2
tzlocal==1.3
wcwidth==0.1.7
widgetsnbextension==3.0.2
1 Like

Bummer, I was hoping something would jump out at me here, but this all looks just as expected :frowning:.
Would it be possible for you to share your files (table-NoContams.qza and metadata-ASSP-Gradient-Foliar.txt) with me in a direct message? Without those files I am unsure as to how I can attempt to recreate this error! Thanks! :t_rex:

@thermokarst Sure, I should also mention that alpha rarefaction does work when I omit the metadata file.

1 Like

Thanks for sharing your data via DM @Lorinda! I think I found the problem - the column Treatment is entirely empty, and the alpha-rarefaction viz doesn’t handle itself well in this case (note: bug report here!). In the meantime, if you just delete the Treatment column, you should be good to go (this worked fine for me when testing locally). Let me know how it goes, and thanks for your patience!!!

Hey @thermokarst I’m not sure I follow you. The description column is populated with ‘gradient’, at least as I see it when I open it up in excel and google sheets, and validating using Keemei. I did try deleting this column though, and still am getting the same error. Maybe you can send me a copy of the metadata that you got to work?

Sorry, I meant the column labeled Treatment - I have edited the above comment to reflect the correct column name!

@thermokarst, It worked! :slight_smile: So for future reference, alpha rarefaction will not work if your metadata file contains a column filled entirely with ‘NA’. Thanks so much for your time on this.

1 Like

The jury is still out on that - perhaps we just don't try and plot the rarefaction curves for that category/column (and show some kind of warning in the viz); or else maybe this is enforced at a higher level - maybe QIIME 2 won't accept any metadata with an empty column? But in the near term, yeah, you should probably just drop any empty columns (I guess there is a higher level question in play here, too --- what does it even mean to have an empty category?)

Thanks so much for sticking with us through this!

3 Likes

There’s a bug fix in the 2017.9 release that ignores empty metadata columns and lists the ignored columns in the output visualization! :tada:

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