HiCExplorer icon indicating copy to clipboard operation
HiCExplorer copied to clipboard

Error in setting hicPlotMatrix --vMin/--vMax

Open sebastian-gregoricchio opened this issue 3 years ago • 4 comments

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.

sebastian-gregoricchio avatar Apr 24 '22 09:04 sebastian-gregoricchio

How to solve it,help.

gsgahvdv avatar May 17 '23 04:05 gsgahvdv

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.

pghzeng avatar Oct 20 '23 13:10 pghzeng

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

kalavattam avatar Oct 20 '23 14:10 kalavattam