arzwa / wgd

Python package and CLI for whole-genome duplication related analyses. This package is deprecated in favor of https://github.com/heche-psb/wgd.
http://wgd.readthedocs.io/en/latest/
GNU General Public License v3.0
80 stars 40 forks source link

error in plot generation in wgd ksd #49

Closed joehagmann closed 3 years ago

joehagmann commented 3 years ago

Hi,

I get the below error when running wgd ksd in the plot generating step. I am running wgd in a singularity shell on a server running ubuntu. Is there a way to circumvent this error using this runtime environment?

And when I come to restart the ksd command, does it resume and use the previously generated intermediate files (I did run it with the --preserve flag)?

Any help greatly appreciated.

[...]
2020-12-10 18:49:17: INFO       Analysis done
2020-12-10 18:49:17: INFO       Making results data frame
2020-12-10 18:57:22: INFO       Removing tmp directory
2020-12-10 18:57:33: INFO       Computing weights, outlier cut-off at Ks > 5
2020-12-10 18:57:39: INFO       Generating plots
Traceback (most recent call last):
  File "/usr/local/bin/wgd", line 8, in <module>
    sys.exit(cli())
  File "/home1/joerg/.local/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home1/joerg/.local/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home1/joerg/.local/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home1/joerg/.local/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home1/joerg/.local/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home1/joerg/.local/lib/python3.8/site-packages/wgd_cli.py", line 633, in ksd
    ksd_(
  File "/home1/joerg/.local/lib/python3.8/site-packages/wgd_cli.py", line 790, in ksd_
    plot_selection(
  File "/home1/joerg/.local/lib/python3.8/site-packages/wgd/viz.py", line 103, in plot_selection
    fig = plt.figure(figsize=(15, 9.27))
  File "/home1/joerg/.local/lib/python3.8/site-packages/matplotlib/pyplot.py", line 687, in figure
    figManager = new_figure_manager(num, figsize=figsize,
  File "/home1/joerg/.local/lib/python3.8/site-packages/matplotlib/pyplot.py", line 315, in new_figure_manager
    return _backend_mod.new_figure_manager(*args, **kwargs)
  File "/home1/joerg/.local/lib/python3.8/site-packages/matplotlib/backend_bases.py", line 3494, in new_figure_manager
    return cls.new_figure_manager_given_figure(num, fig)
  File "/home1/joerg/.local/lib/python3.8/site-packages/matplotlib/backends/_backend_tk.py", line 885, in new_figure_manager_given_figure
    window = tk.Tk(className="matplotlib")
  File "/usr/lib/python3.8/tkinter/__init__.py", line 2261, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: couldn't connect to display "localhost:13.0"
arzwa commented 3 years ago

Frankly, I'm not sure, I haven't used the singularity container in years (so it could be due to python3.8 or other packages that are updated but for which I did not sufficiently stringently specified dependencies... alternatively it maybe some setting in your system that's causing this). At any rate you should not have to rerun the ksd command, since everything is done, only the plots failed. You can visualize the computed distributions using wgd viz or whatever graphics software you're used to (see e.g. #24 #26 if you're an R user).

joehagmann commented 3 years ago

Thanks for your reply. Issue solved after emptying the PYTHONPATH env variable. It was on my part, so I will close this issue.