Issue with log transformation in `fancplot -p square`
kalavattam opened this issue · 0 comments
kalavattam commented
Hi again,
I believe I have encountered a bug when using the -l
flag for log transformation in fancplot -p square
.
I am using version 0.9.27
of FAN-C:
❯ fancplot --version
0.9.27
When I attempt to plot with the -l
flag, I encounter the following error:
❯ fancplot \
> -o "${out}" \
> "${coord}" \
> -p ${shape} -l -vmin ${vmin} -vmax ${vmax} \
> --title "${title}" \
> -c "${matcol}" \
> "${i}"
2023-10-12 10:33:15,173 INFO Using non-interactive backend
2023-10-12 10:33:15,573 INFO Found 1 regions
/home/kalavatt/miniconda3/envs/fanc_pip_env/bin/fancplot:187: UserWarning: There was an error with plot 0, region XII:1-1078177 (Traceback (most recent call last):
File "/home/kalavatt/miniconda3/envs/fanc_pip_env/bin/fancplot", line 170, in __init__
fig, axes = gf.plot(plot_region)
^^^^^^^^^^^^^^^^^^^^
File "/home/kalavatt/miniconda3/envs/fanc_pip_env/lib/python3.11/site-packages/fanc/plotting/plotter.py", line 211, in plot
p.plot(r)
File "/home/kalavatt/miniconda3/envs/fanc_pip_env/lib/python3.11/site-packages/fanc/plotting/base_plotter.py", line 785, in plot
plot_output = self._plot((x_region, y_region))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/kalavatt/miniconda3/envs/fanc_pip_env/lib/python3.11/site-packages/fanc/plotting/hic_plotter.py", line 299, in _plot
self._refresh(region)
File "/home/kalavatt/miniconda3/envs/fanc_pip_env/lib/python3.11/site-packages/fanc/plotting/hic_plotter.py", line 355, in _refresh
self.im = self.ax.imshow(color_matrix, interpolation='none', aspect='auto',
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/kalavatt/miniconda3/envs/fanc_pip_env/lib/python3.11/site-packages/matplotlib/__init__.py", line 1465, in inner
return func(ax, *map(sanitize_sequence, args), **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/kalavatt/miniconda3/envs/fanc_pip_env/lib/python3.11/site-packages/matplotlib/axes/_axes.py", line 5756, in imshow
im._scale_norm(norm, vmin, vmax)
File "/home/kalavatt/miniconda3/envs/fanc_pip_env/lib/python3.11/site-packages/matplotlib/cm.py", line 436, in _scale_norm
self.autoscale_None()
File "/home/kalavatt/miniconda3/envs/fanc_pip_env/lib/python3.11/site-packages/matplotlib/cm.py", line 673, in autoscale_None
self.norm.autoscale_None(self._A)
File "/home/kalavatt/miniconda3/envs/fanc_pip_env/lib/python3.11/site-packages/matplotlib/colors.py", line 1771, in autoscale_None
in_trf_domain = np.extract(np.isfinite(self._trf.transform(A)), A)
^^^^^^^^^^^^^^^^^^^^^^
File "/home/kalavatt/miniconda3/envs/fanc_pip_env/lib/python3.11/site-packages/matplotlib/transforms.py", line 1505, in transform
raise ValueError(
ValueError: Input values must have shape (N, 1) or (1,)
)
warnings.warn("There was an error with plot {}, region {}:{}-{} ({})".format(i, region.chromosome,
2023-10-12 10:33:15,790 WARNING Input values must have shape (N, 1) or (1,)
Closing remaining open files:10_fanc_XII_KR-filt-0.2/MC-2019_Q_WT_repM.standard-rDNA-complete.mapped.6400.downsample-to-G1.hic...done
However, when I plot without the -l
flag, everything works as expected:
❯ fancplot \
> -o "${out}" \
> "${coord}" \
> -p ${shape} -vmin ${vmin} -vmax ${vmax} \
> --title "${title}" \
> -c "${matcol}" \
> "${i}"
2023-10-12 10:33:41,264 INFO Using non-interactive backend
2023-10-12 10:33:41,579 INFO Found 1 regions
Closing remaining open files:10_fanc_XII_KR-filt-0.2/MC-2019_Q_WT_repM.standard-rDNA-complete.mapped.6400.downsample-to-G1.hic...done
Also, fancplot -p triangular
works as expected with or without the -l
flag, so it seems to be something to do with square
. Have not tested split
or mirror
.
Thank you.