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
227 stars 70 forks source link

hicPlotTADs:ValueError #840

Closed songxh1996 closed 1 year ago

songxh1996 commented 1 year ago

Hi I met one error with the hicplotTAD. Do you have any idea about this?

Thanks

(hic1) [songxh@cu01 juicehicPlotTADs --tracks tracks.ini -o hic_track.png --region NC_037545.1:2500000-3500000 INFO:pygenometracks.tracksClass:initialize 1. [x-axis] INFO:pygenometracks.tracksClass:initialize 2. [spacer] INFO:pygenometracks.tracksClass:initialize 3. [hicexplorer_KR_matrix] INFO:pygenometracks.tracksClass:initialize 4. [hicexplorer_KR_matrix.h5_domains] 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3199/3199 [00:00<00:00, 36556.08it/s] INFO:pygenometracks.tracksClass:time initializing track(s): INFO:pygenometracks.tracksClass:98.09827876091003 DEBUG:pygenometracks.tracksClass:Figure size in cm is 40 x 9.595193967050644. Dpi is set to 72

INFO:pygenometracks.tracksClass:plotting 1. [x-axis] INFO:pygenometracks.tracksClass:plotting 2. [spacer] INFO:pygenometracks.tracksClass:plotting 3. [hicexplorer_KR_matrix] INFO:pygenometracks.tracks.GenomeTrack:setting min, max values for track 3. [hicexplorer_KR_matrix] to: 1.0, 56.8895900574166

Traceback (most recent call last): File "/home/songxh/miniconda3/envs/hic1/bin/hicPlotTADs", line 7, in main() File "/home/songxh/miniconda3/envs/hic1/lib/python3.8/site-packages/hicexplorer/hicPlotTADs.py", line 9, in main plotTracks.main(args) File "/home/songxh/miniconda3/envs/hic1/lib/python3.8/site-packages/pygenometracks/plotTracks.py", line 311, in main trp.plot(args.outFileName, region, title=args.title, File "/home/songxh/miniconda3/envs/hic1/lib/python3.8/site-packages/pygenometracks/tracksClass.py", line 270, in plot track.plot(plot_axis, chrom, start, end) File "/home/songxh/miniconda3/envs/hic1/lib/python3.8/site-packages/pygenometracks/tracks/HiCMatrixTrack.py", line 274, in plot self.img = self.pcolormesh_45deg(ax, matrix, start_pos, vmax=vmax, vmin=vmin) File "/home/songxh/miniconda3/envs/hic1/lib/python3.8/site-packages/pygenometracks/tracks/HiCMatrixTrack.py", line 336, in pcolormesh_45deg im = ax.pcolormesh(x, y, np.flipud(matrix_c), File "/home/songxh/miniconda3/envs/hic1/lib/python3.8/site-packages/matplotlib/init.py", line 1423, in inner return func(ax, map(sanitize_sequence, args), **kwargs) File "/home/songxh/miniconda3/envs/hic1/lib/python3.8/site-packages/matplotlib/axes/_axes.py", line 6174, in pcolormesh collection._scale_norm(norm, vmin, vmax) File "/home/songxh/miniconda3/envs/hic1/lib/python3.8/site-packages/matplotlib/cm.py", line 436, in _scale_norm raise ValueError( ValueError: Passing a Normalize instance simultaneously with vmin/vmax is not supported. Please pass vmin/vmax directly to the norm when creating it.

(hic1) [songxh@cu01 juicer]$ cat tracks.ini

[x-axis]

[spacer] height = 0.5

[hicexplorer_KR_matrix] file = hicexplorer_KR_matrix.h5

title = hicexplorer_KR_matrix depth = 100000 transform = log1p show_masked_bins = false file_type = hic_matrix

[hicexplorer_KR_matrix.h5_domains] file = ./tad/hicexplorer_KR_matrix.h5_domains.bed

title = hicexplorer_KR_matrix.h5_domains height = 2 color = darkblue height = 5 labels = false fontsize = 10 file_type = bed

(hic1) [songxh@cu01 juicer]$ pgt --version pgt 3.3 (hic1) [songxh@cu01 juicer]$ python --version Python 3.8.12 (hic1) [songxh@cu01 juicer]$ conda list | grep matplotlib matplotlib 3.6.2 py38h06a4308_0 matplotlib-base 3.6.2 py38h945d387_0 matplotlib-inline 0.1.6 py38h06a4308_0

lldelisle commented 1 year ago

Hi, You need to upgrade pgt you are using 3.3, we are on 3.8. How did you installed pgt? With conda we do not allow this configuration: matplotlib 3.6.2 with pyGenomeTracks(pgt) 3.3

songxh1996 commented 1 year ago

嗨,您需要升级您正在使用 3.3 的 pgt,我们在 3.8 上。你是如何安装 pgt 的?对于 conda,我们不允许这种配置:matplotlib 3.6.2 with pyGenomeTracks(pgt) 3.3

hello,thanks I performed "conda install hicexplorer -c bioconda -c conda-forge" on "hic1" enverment with python3.8

how to upgrade pgt?

lldelisle commented 1 year ago

Can you do a conda list | grep pygenometracks, please? And which pgt? Thanks you

songxh1996 commented 1 year ago

Can you do a conda list | grep pygenometracks, please? And which pgt? Thanks you

(hic1) [songxh@mu01 ~]$ which pgt ~/miniconda3/envs/hic1/bin/pgt (hic1) [songxh@mu01 ~]$ conda list |grep pygenometracks pygenometracks 3.3 py_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bi oconda

lldelisle commented 1 year ago

Can you try: conda update -c bioconda -c conda-forge pygenometracks

songxh1996 commented 1 year ago

Can you try: conda update -c bioconda -c conda-forge pygenometracks

1677673201684

failed

lldelisle commented 1 year ago

Would you mind to create a fresh conda environment? You can either replace your hic1 or use another name:

conda create -n hic1 --override-channels --channel conda-forge --channel bioconda python=3.8 hicexplorer=3.7.2 pygenometracks=3.8

Or using mamba:

conda create -n hic1 --override-channels --channel conda-forge --channel bioconda python=3.8 mamba
conda activate hic1
mamba install --override-channels --channel conda-forge --channel bioconda hicexplorer=3.7.2 pygenometracks=3.8

I don't know the tuna mirror but it seems it is causing issues.

songxh1996 commented 1 year ago
conda create -n hic1 --override-channels --channel conda-forge --channel bioconda python=3.8 mamba
conda activate hic1
mamba install --override-channels --channel conda-forge --channel bioconda hicexplorer=3.7.2 pygenometracks=3.8

Thank you very much for your suggestion, I have managed to get the picture through the script you gave your command. best wishes

lldelisle commented 1 year ago

Great