Error in qiime feature-table summarize

Good morning,

When trying to summarize a merged table from 4 denoised sequence variant data I got the following error:

What is this DISPLAY variable? And how can I fix it?

Thank you!

(qiime2) ekg43@thompson:~/SCC/Dada$ qiime feature-table summarize --i-table table1234.qza --o-visualization table1234
Traceback (most recent call last):
  File "/home/ekg43/miniconda3/envs/qiime2/bin/qiime", line 6, in <module>
    sys.exit(q2cli.__main__.qiime())
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/contextlib.py", line 77, in __exit__
    self.gen.throw(type, value, traceback)
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/click/core.py", line 86, in augment_usage_errors
    yield
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/q2cli-0.0.6-py3.5.egg/q2cli/commands.py", line 210, in __call__
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/contextlib.py", line 77, in __exit__
    self.gen.throw(type, value, traceback)
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/qiime-2.0.6-py3.5.egg/qiime/util.py", line 27, in redirected_stdio
    yield
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/contextlib.py", line 77, in __exit__
    self.gen.throw(type, value, traceback)
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/qiime-2.0.6-py3.5.egg/qiime/util.py", line 53, in _redirected_fd
    yield stdio  # allow code to be run with the redirected stdio
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/qiime-2.0.6-py3.5.egg/qiime/util.py", line 25, in redirected_stdio
    yield
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/contextlib.py", line 77, in __exit__
    self.gen.throw(type, value, traceback)
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/qiime-2.0.6-py3.5.egg/qiime/util.py", line 53, in _redirected_fd
    yield stdio  # allow code to be run with the redirected stdio
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/qiime-2.0.6-py3.5.egg/qiime/util.py", line 25, in redirected_stdio
    yield
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/q2cli-0.0.6-py3.5.egg/q2cli/commands.py", line 210, in __call__
  File "<decorator-gen-211>", line 2, in summarize
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/qiime-2.0.6-py3.5.egg/qiime/core/callable.py", line 227, in callable_wrapper
    output_types, provenance)
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/qiime-2.0.6-py3.5.egg/qiime/core/callable.py", line 426, in _callable_executor_
    ret_val = callable(output_dir=temp_dir, **view_args)
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/q2_feature_table-0.0.6-py3.5.egg/q2_feature_table/_summarize/_visualizer.py", line 47, in summarize
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/seaborn/distributions.py", line 162, in distplot
    ax = plt.gca()
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/matplotlib/pyplot.py", line 928, in gca
    return gcf().gca(**kwargs)
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/matplotlib/pyplot.py", line 578, in gcf
    return figure()
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/matplotlib/pyplot.py", line 527, in figure
    **kwargs)
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/matplotlib/backends/backend_qt4agg.py", line 46, in new_figure_manager
    return new_figure_manager_given_figure(num, thisFig)
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/matplotlib/backends/backend_qt4agg.py", line 53, in new_figure_manager_given_figure
    canvas = FigureCanvasQTAgg(figure)
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/matplotlib/backends/backend_qt4agg.py", line 76, in __init__
    FigureCanvasQT.__init__(self, figure)
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/matplotlib/backends/backend_qt4.py", line 68, in __init__
    _create_qApp()
  File "/home/ekg43/miniconda3/envs/qiime2/lib/python3.5/site-packages/matplotlib/backends/backend_qt5.py", line 138, in _create_qApp
    raise RuntimeError('Invalid DISPLAY variable')
RuntimeError: Invalid DISPLAY variable
1 Like

Hi @ErikaGanda, it looks like you might be running on a headless machine (as in, no monitor connected)? If so, you need to configure your matplotlib backend to use a renderer that supports headless operations (e.g. Agg):

echo "backend: Agg" > ~/.config/matplotlib/matplotlibrc

Please note, if this is in fact a headless machine, qiime tools view will not work for viewing your QZV files (because there is no display to use!), so please consider one of the alternatives linked to here:

Let us know if that works for you! Thanks!

1 Like

Thank you, transferring it all to my mac worked!

This is funny though, because I was able to produce the quality plots with no problem on the headless server and just copied the artifact into my mac to visualize in view.qiime2.org

Interesting that this time it wouldn’t even produce the artifact…

Thanks so much for the quick response!

The quality score plots are generated using R, which seems to work out-of-the-box on a headless sever. feature-table summarize uses matplotlib (in Python) to generate the visualization. The solution @thermokarst posted instructs matplotlib to use a headless rendering backend (matplotlib's default backend usually requires a display).

Glad to hear it's working!

1 Like

Thanks for explaining it @jairideout!

1 Like