vaquerizaslab / fanc

FAN-C: Framework for the ANalysis of C-like data
GNU General Public License v3.0
107 stars 14 forks source link

Issue with fancplot #178

Open TomSexton00 opened 11 months ago

TomSexton00 commented 11 months ago

Hi, I've been a satisfied user of FAN-C for a number of years, but after a recent wave of server updates (we are now on FANC/0.9.27), there is now a bug with running a fancplot command which previously worked:

fancplot [REGION] -p triangular -vmax 0.05 [HIC OBJECT]

Now returns this error message:

/shared/software/miniconda3-admin/envs/fanc-0.9.27/bin/fancplot:187: UserWarning: There was an error with plot 0, region chr10:15000000-16000000 (Traceback (most recent call last):
  File "/shared/software/miniconda3-admin/envs/fanc-0.9.27/bin/fancplot", line 170, in __init__
    fig, axes = gf.plot(plot_region)
  File "/shared/home/sexton/.local/lib/python3.9/site-packages/fanc/plotting/plotter.py", line 211, in plot
    p.plot(r)
  File "/shared/home/sexton/.local/lib/python3.9/site-packages/fanc/plotting/base_plotter.py", line 293, in plot
    self._after_plot(region)
  File "/shared/home/sexton/.local/lib/python3.9/site-packages/fanc/plotting/base_plotter.py", line 581, in _after_plot
    self.add_colorbar()
  File "/shared/home/sexton/.local/lib/python3.9/site-packages/fanc/plotting/base_plotter.py", line 651, in add_colorbar
    self.update_colorbar(vmin=self.vmin, vmax=self.vmax, baseline=baseline)
  File "/shared/home/sexton/.local/lib/python3.9/site-packages/fanc/plotting/base_plotter.py", line 669, in update_colorbar
    self.colorbar.draw_all()
AttributeError: 'Colorbar' object has no attribute 'draw_all'
)
  warnings.warn("There was an error with plot {}, region {}:{}-{} ({})".format(i, region.chromosome,
2023-12-13 11:44:13,046 WARNING 'Colorbar' object has no attribute 'draw_all'

Many thanks for your advice.

kaukrise commented 11 months ago

Hi Tom,

sorry about the delay - the time leading up to the holidays is always particularly busy.

The error is due to recent updates in Matplotlib. However, FAN-C 0.9.27 should have fixed the issue. Can you run

fancplot -V

to double-check that the correct version is installed? Sometimes the executable points to an older version despite being installed in a different environment.

I also downloaded the 0.9.27 source files directly from Pypi and the line that raises the error in your case (669 in base_plotter.py) is different. It should read

self.cax.figure.draw_without_rendering()

I hope you can figure out where the version mismatch comes from!

Best,

Kai

TomSexton00 commented 11 months ago

Hi Kai,

Thanks. Indeed, the fancplot running is 0.9.25. I will see with IT about getting the proper update, and hopefully that will fix things.

Happy Christmas to you and everyone else from the Vaquerizas lab, past and present, who see this!

Tom


From: kaukrise @.***> Sent: 20 December 2023 08:02:39 To: vaquerizaslab/fanc Cc: Thomas SEXTON; Author Subject: Re: [vaquerizaslab/fanc] Issue with fancplot (Issue #178)

Hi Tom,

sorry about the delay - the time leading up to the holidays is always particularly busy.

The error is due to recent updates in Matplotlib. However, FAN-C 0.9.27 should have fixed the issue. Can you run

fancplot -V

to double-check that the correct version is installed? Sometimes the executable points to an older version despite being installed in a different environment.

I also downloaded the 0.9.27 source files directly from Pypihttps://pypi.org/project/fanc/#files and the line that raises the error in your case (669 in base_plotter.py) is different. It should read

self.cax.figure.draw_without_rendering()

I hope you can figure out where the version mismatch comes from!

Best,

Kai

— Reply to this email directly, view it on GitHubhttps://github.com/vaquerizaslab/fanc/issues/178#issuecomment-1863951297, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AMMEDKDA6HQ7ECG3DU5QVC3YKKEQ7AVCNFSM6AAAAABAS6GE4WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRTHE2TCMRZG4. You are receiving this because you authored the thread.Message ID: @.***>

TomSexton00 commented 11 months ago

Hi again,

Yep, that's solved!

Many thanks,

Tom


From: Thomas SEXTON Sent: 20 December 2023 08:18:40 To: vaquerizaslab/fanc; vaquerizaslab/fanc Cc: Author Subject: Re: [vaquerizaslab/fanc] Issue with fancplot (Issue #178)

Hi Kai,

Thanks. Indeed, the fancplot running is 0.9.25. I will see with IT about getting the proper update, and hopefully that will fix things.

Happy Christmas to you and everyone else from the Vaquerizas lab, past and present, who see this!

Tom


From: kaukrise @.***> Sent: 20 December 2023 08:02:39 To: vaquerizaslab/fanc Cc: Thomas SEXTON; Author Subject: Re: [vaquerizaslab/fanc] Issue with fancplot (Issue #178)

Hi Tom,

sorry about the delay - the time leading up to the holidays is always particularly busy.

The error is due to recent updates in Matplotlib. However, FAN-C 0.9.27 should have fixed the issue. Can you run

fancplot -V

to double-check that the correct version is installed? Sometimes the executable points to an older version despite being installed in a different environment.

I also downloaded the 0.9.27 source files directly from Pypihttps://pypi.org/project/fanc/#files and the line that raises the error in your case (669 in base_plotter.py) is different. It should read

self.cax.figure.draw_without_rendering()

I hope you can figure out where the version mismatch comes from!

Best,

Kai

— Reply to this email directly, view it on GitHubhttps://github.com/vaquerizaslab/fanc/issues/178#issuecomment-1863951297, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AMMEDKDA6HQ7ECG3DU5QVC3YKKEQ7AVCNFSM6AAAAABAS6GE4WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRTHE2TCMRZG4. You are receiving this because you authored the thread.Message ID: @.***>

ReytylerDurden commented 10 months ago

Hi, i'm having a similar problem, but i've recently installed fanc for the first time, so is likely that the problem is me. My version of fancplot is the latest, like matplotlib, there is the error:


File "/home/omen/PycharmProjects/FancExt/main.py", line 30, in <module>
    p.plot('chr3')

File "/home/omen/Scrivania/venv/lib/python3.11/site-packages/fanc/plotting/base_plotter.py", line 293, in plot
    self._after_plot(region)

File "/home/omen/Scrivania/venv/lib/python3.11/site-packages/fanc/plotting/base_plotter.py", line 581, in _after_plot
    self.add_colorbar()

File "/home/omen/Scrivania/venv/lib/python3.11/site-packages/fanc/plotting/base_plotter.py", line 650, in add_colorbar
    self.colorbar = plt.colorbar(cmap_data, cax=ax, **kwargs)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/omen/Scrivania/venv/lib/python3.11/site-packages/matplotlib/pyplot.py", line 2326, in colorbar
    ret = gcf().colorbar(mappable, cax=cax, ax=ax, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/omen/Scrivania/venv/lib/python3.11/site-packages/matplotlib/figure.py", line 1285, in colorbar
    raise ValueError(
ValueError: Unable to determine Axes to steal space for Colorbar. Either provide the *cax* argument to use as the Axes for the Colorbar, provide the *ax* argument to steal space from it, or add *mappable* to an Axes.`

I would like to take this opportunity to wish you a merry Christmas and kindly thank you for your support Ciro