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

hicPCA error: IndexError: list index out of range. raise ValueError('`x` and `y` must have length at least 2.') ValueError: `x` and `y` must have length at least 2. #907

Open shRDJr opened 1 month ago

shRDJr commented 1 month ago

Hi, when I was running hicPCA to get compartment, I encountered the following error. I checked the extraTrack bed file and found nothing wrong with the format. How can I solve this problem?

ERROR:hicmatrix.HiCMatrix:Index error Traceback (most recent call last): File "/work/home/ac9kx9ps3t/mambaforge/envs/hicexplorer/lib/python3.12/site-packages/hicmatrix/HiCMatrix.py", line 262, in getRegionBinRange endbin = sorted(self.interval_trees[chrname][endpos:endpos + 1])[0].data


IndexError: list index out of range
WARNING:hicexplorer.hicPCA:Your chromosome sizes do not match the chromosome sizes of the extraTrack data!
WARNING:hicexplorer.hicPCA:Your chromosome Contig2063_pilon; Size 10393. ExtraTrack data Contig2063_pilon 2889 10393
WARNING:hicexplorer.hicPCA:Please create your interaction matrix with a chromosome size file! However, if the sizes are intended and it is accepted that certain regions are not part of the correlation, you can ignore this message.
Traceback (most recent call last):
  File "/work/home/ac9kx9ps3t/mambaforge/envs/hicexplorer/bin/hicPCA", line 7, in <module>
    main()
  File "/work/home/ac9kx9ps3t/mambaforge/envs/hicexplorer/lib/python3.12/site-packages/hicexplorer/hicPCA.py", line 355, in main
    vecs_list = correlateEigenvectorWithGeneTrack(ma, vecs_list, args.extraTrack)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/work/home/ac9kx9ps3t/mambaforge/envs/hicexplorer/lib/python3.12/site-packages/hicexplorer/hicPCA.py", line 190, in correlateEigenvectorWithGeneTrack
    _correlation = pearsonr(np.array(eigenvector[bin_id[0]:bin_id[1]]).real,
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/work/home/ac9kx9ps3t/mambaforge/envs/hicexplorer/lib/python3.12/site-packages/scipy/stats/_stats_py.py", line 4814, in pearsonr
    raise ValueError('`x` and `y` must have length at least 2.')
ValueError: `x` and `y` must have length at least 2.