centre-for-virus-research / weeSAM

Script for parsing SAM/BAM files for coverage statistics
GNU General Public License v3.0
14 stars 7 forks source link

matplotlib issue #13

Open josephhughes opened 3 years ago

josephhughes commented 3 years ago

weeSAM --bam SARS-CoV-2.bam --html SARS1 --overwrite /usr/local/bin/weeSAM:54: UserWarning: This call to matplotlib.use() has no effect because the backend has already been chosen; matplotlib.use() must be called before pylab, matplotlib.pyplot, or matplotlib.backends is imported for the first time. The backend was originally set to 'TkAgg' by the following code: File "/usr/local/bin/weeSAM", line 52, in import seaborn as sb File "/opt/miniconda3/lib/python3.7/site-packages/seaborn/init.py", line 2, in from .rcmod import * # noqa: F401,F403 File "/opt/miniconda3/lib/python3.7/site-packages/seaborn/rcmod.py", line 7, in from . import palettes File "/opt/miniconda3/lib/python3.7/site-packages/seaborn/palettes.py", line 9, in from .utils import desaturate, get_color_cycle File "/opt/miniconda3/lib/python3.7/site-packages/seaborn/utils.py", line 14, in import matplotlib.pyplot as plt File "/opt/miniconda3/lib/python3.7/site-packages/matplotlib/pyplot.py", line 71, in from matplotlib.backends import pylab_setup File "/opt/miniconda3/lib/python3.7/site-packages/matplotlib/backends/init.py", line 17, in line for line in traceback.format_stack() matplotlib.use('agg') ---- Processing: SARS-CoV-2.bam ---- Total # Mapped Reads: 212313 Total # Unmapped Reads: 0 Total # Reads: 212313 Generating a depth file, this may take a while. Processing: SARS-CoV-2 .... Traceback (most recent call last): File "/usr/local/bin/weeSAM", line 797, in process_bam(bam_list) File "/usr/local/bin/weeSAM", line 657, in process_bam fig = my_plot(min_dict[i], i) File "/usr/local/bin/weeSAM", line 343, in my_plot fig = plt.figure(figsize=(16, 6)) File "/opt/miniconda3/lib/python3.7/site-packages/matplotlib/pyplot.py", line 533, in figure **kwargs) File "/opt/miniconda3/lib/python3.7/site-packages/matplotlib/backend_bases.py", line 161, in new_figure_manager return cls.new_figure_manager_given_figure(num, fig) File "/opt/miniconda3/lib/python3.7/site-packages/matplotlib/backends/_backend_tk.py", line 1046, in new_figure_manager_given_figure window = Tk.Tk(className="matplotlib") File "/opt/miniconda3/lib/python3.7/tkinter/init.py", line 2023, in init self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use) _tkinter.TclError: no display name and no $DISPLAY environment variable

mvvucak commented 3 years ago

I'm unable to reproduce this on Alpha with my set-up. Could you tell me what versions of seaborn and matplotlib your environment is using? Also, is this happening on a local machine or while connecting to Alpha remotely?

It looks like Seaborn is setting matplotlib's backend to 'TkAgg' which is interactive and requires ssh -X or ssh -Y to function. Might be a quick fix if that's the issue.

josephhughes commented 3 years ago

This isn't on Alpha. I'm thinking we may need to test weeSAM on more systems or roll-it back to a version with fewer dependencies.

On Mon, Jun 28, 2021 at 5:00 PM mvvucak @.***> wrote:

I'm unable to reproduce this on Alpha with my set-up. Could you tell me what versions of seaborn and matplotlib your environment is using? Also, is this happening on a local machine or while connecting to Alpha remotely?

It looks like Seaborn is setting matplotlib's backend to 'TkAgg' which is interactive and requires ssh -X or ssh -Y to function. Might be a quick fix if that's the issue.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/centre-for-virus-research/weeSAM/issues/13#issuecomment-869807177, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACXZAMSS7NFQLDA6BI7RWDTVCMC7ANCNFSM47NXA5YQ .