Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does PlotHiC be available for non-AutoHiC result now? #1

Open
wu116 opened this issue Dec 27, 2024 · 1 comment
Open

Does PlotHiC be available for non-AutoHiC result now? #1

wu116 opened this issue Dec 27, 2024 · 1 comment

Comments

@wu116
Copy link

wu116 commented Dec 27, 2024

Thanks for such a nice tools!

But I encountered difficulties in using plothic with HiC-Pro result. I generated a .hic file with hicpro2juicebox.sh a while ago and tried to re-plot HiC heatmap with PlotHiC command like:
plothic -hic sample1.allValidPairs.hic -chr ../chr.sizes -r 100000

This threw out an error:

File "/home/A/miniconda3/envs/plothic/lib/python3.10/site-packages/plothic/ParseHiC.py", line 25, in parse_hic
    hic_max_len = chr_info["assembly"]
KeyError: 'assembly'

I've checked the chr_info and it only contained "ALL" and the other chromosome IDs:

{'ALL': 630988, 'OMOSOME1': 19002562, 'OMOSOME2': 18725070, ...... ,'OMOSOME39': 19189786, 'OMOSOME40': 19427610}

So I modified all the 'assembly' to 'ALL'.

hic_max_len = chr_info["assembly"]
matrix_end = hic_max_len if matrix_end is None else matrix_end
# logger.info(f"HiC data assembly chromosome length: {hic_max_len}")
res_max_len = resolution * 1400
matrix_obj = hic_obj.getMatrixZoomData('assembly', 'assembly', data_type, normalization, "BP", resolution)

This time hicstraw threw out: Error finding block data
So i changed 'ALL' to 'OMOSOME1' and 'OMOSOME40' in line 31 for test but still get new error:

Traceback (most recent call last):
  File "/home/A/miniconda3/envs/plothic/bin/plothic", line 8, in <module>
    sys.exit(main())
  File "/home/A/miniconda3/envs/plothic/lib/python3.10/site-packages/plothic/cli.py", line 35, in main
    plot_hic(args.hic_file, chr_txt=args.chr_txt, output=args.output, resolution=args.resolution,
  File "/home/A/miniconda3/envs/plothic/lib/python3.10/site-packages/plothic/PlotHiC.py", line 61, in plot_hic
    plot_matrix(matrix, chr_info=chr_info_sorted, outfile=output, genome_name=genome_name, fig_size=fig_size, dpi=dpi,
  File "/home/A/miniconda3/envs/plothic/lib/python3.10/site-packages/plothic/PlotMTX.py", line 29, in plot_matrix
    fig, ax = plt.subplots(1, 1, figsize=fig_size, dpi=dpi)
  File "/home/A/miniconda3/envs/plothic/lib/python3.10/site-packages/matplotlib/pyplot.py", line 1775, in subplots
    fig = figure(**fig_kw)
  File "/home/A/miniconda3/envs/plothic/lib/python3.10/site-packages/matplotlib/pyplot.py", line 1042, in figure
    manager = new_figure_manager(
  File "/home/A/miniconda3/envs/plothic/lib/python3.10/site-packages/matplotlib/pyplot.py", line 552, in new_figure_manager
    return _get_backend_mod().new_figure_manager(*args, **kwargs)
  File "/home/A/miniconda3/envs/plothic/lib/python3.10/site-packages/matplotlib/backend_bases.py", line 3500, in new_figure_manager
    fig = fig_cls(*args, **kwargs)
  File "/home/A/miniconda3/envs/plothic/lib/python3.10/site-packages/matplotlib/figure.py", line 2626, in __init__
    self.bbox_inches = Bbox.from_bounds(0, 0, *figsize)

Could you help me to figure it out? Thank!

@Jwindler
Copy link
Owner

Currently PlotHiC is used for visualization after genome scaffolding. The data format you mentioned will be supported later. If possible, could you send me the file for testing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants