deeptools / HiCExplorer

HiCExplorer is a powerful and easy to use set of tools to process, normalize and visualize Hi-C data.
https://hicexplorer.readthedocs.org
GNU General Public License v3.0
233 stars 70 forks source link

Error in setting hicPlotMatrix --vMin/--vMax #793

Open sebastian-gregoricchio opened 2 years ago

sebastian-gregoricchio commented 2 years ago

Currently using version 3.7.2.

When I use --log1p and --vMin/--vMax simultaneously it returns the following error (that i imagine comes from matplotlib, in my case: matplotlib-base ==3.5.1, matplotlib-inline==0.1.3)

My command:

hicPlotMatrix \
-m input_mat.cool \
--region 'chr8:151693700-152742276' \
-o mat_plot.pdf \
--colorMap RdBu_r \
--vMax 1 \
--vMin -1 \
--log1p

And this the error:

INFO:hicexplorer.hicPlotMatrix:Cooler or no cooler: True
Traceback (most recent call last):
  File "/home/user/.conda/envs/HiC/bin/hicPlotMatrix", line 7, in <module>
    main()
  File "/home/user/.conda/envs/HiC/lib/python3.8/site-packages/hicexplorer/hicPlotMatrix.py", line 820, in main
    plotHeatmap(matrix, ma.get_chromosome_sizes(), fig, position,
  File "/home/user/.conda/envs/HiC/lib/python3.8/site-packages/hicexplorer/hicPlotMatrix.py", line 244, in plotHeatmap
    img3 = axHeat2.pcolormesh(
  File "/home/user/.conda/envs/HiC/lib/python3.8/site-packages/matplotlib/__init__.py", line 1412, in inner
    return func(ax, *map(sanitize_sequence, args), **kwargs)
  File "/home/user/.conda/envs/HiC/lib/python3.8/site-packages/matplotlib/axes/_axes.py", line 6073, in pcolormesh
    collection._scale_norm(norm, vmin, vmax)
  File "/home/user/.conda/envs/HiC/lib/python3.8/site-packages/matplotlib/cm.py", line 380, in _scale_norm
    raise ValueError(
ValueError: Passing parameters norm and vmin/vmax simultaneously is not supported. Please pass vmin/vmax directly to the norm when creating it.
gsgahvdv commented 1 year ago

How to solve it,help.

sebastian-gregoricchio commented 1 year ago

actually I ended up in using GENOVA (RH van der Weide, et al., NAR Genom. & Bioinfo., 2021)

pghzeng commented 1 year ago

I've checked the code of hicPlotMatrix and it seems this problem is due to upgrade of matplotlib, and usage of function pcolormesh() has changed. So the answer is rebuild a conda environment specifically for hicexplorer.

kalavattam commented 1 year ago

An explanation for the issue and a way to address it is described in this issue report: https://github.com/deeptools/HiCExplorer/issues/873