parklab / HiNT

HiC for copy Number variation and Translocation detection
MIT License
35 stars 8 forks source link

ValueError: row index exceeds matrix dimensions #24

Open walidabualafia opened 1 year ago

walidabualafia commented 1 year ago

Hi all,

I am trying to run HiNT on the example dataset, but it keeps failing. I installed hint from Conda, using the following steps:

It installs without error, and when I run hint --version, I get back hint 2.2.8. I am running on a RHEL8 cluster.

However, I am trying to run this script:

#!/bin/bash
#

hint tl \
  -m ${HINT_DIR}/db/testData/test.hic \
  -f juicer --refdir ${HINT_DIR}/db/refData/hg38/ \
  --backdir ${HINT_DIR}/db/backgroundMatrices/hg38 \
  -g hg38 \
  -n 4DNFICSTCJQZ \
  -c 0.05 \
  --ppath pairix \
  -o HiNTtransl_juicerOUTPUTXX

Whenever I run it, I am faced with the following error:

noderome106 >> ~ # bash run_hint.sh
[09:43:31] Argument List:
[09:43:31] Hi-C contact matrix = ${HINT_ENV}/db/testData/test.hic
[09:43:31] Hi-C contact matrix format = juicer
[09:43:31] Genome = hg38
[09:43:31] Name = 4DNFICSTCJQZ
[09:43:31] Output directory = HiNTtransl_juicerOUTPUTXX
[09:43:31] Prepare Matrices!
HiC version:  8
Traceback (most recent call last):
  File "${HINT_ENV}/bin/hint", line 203, in <module>
    main()
  File "${HINT_ENV}/bin/hint", line 199, in main
    translrun(argparser)
  File "${HINT_ENV}/lib/python3.6/site-packages/HiNT/runhint.py", line 112, in translrun
    matrix1MbInfo = hicToMatrix(opts.matrixfile, 1000, chromlengthf, opts.outdir, opts.name)
  File "${HINT_ENV}/lib/python3.6/site-packages/HiNT/hicToMatrix.py", line 44, in hicToMatrix
    dumpMatrix(chrom1, chrom2, resolution, hicfile, chromInfo,outputname)
  File "${HINT_ENV}/lib/python3.6/site-packages/HiNT/hicToMatrix.py", line 29, in dumpMatrix
    res = coo_matrix((data, (row, col)), shape=(binnumber1, binnumber2)).toarray()
  File "${HINT_ENV}/lib/python3.6/site-packages/scipy/sparse/coo.py", line 196, in __init__
    self._check()
  File "${HINT_ENV}/lib/python3.6/site-packages/scipy/sparse/coo.py", line 283, in _check
    raise ValueError('row index exceeds matrix dimensions')
ValueError: row index exceeds matrix dimensions

This feels like a bug in the software, as I have installed it multiple times, in many different ways, and cannot get past this. I also saw that I user reported this issue a while back, but did not get a response.

FYI: I did not use the env var ${HINT_ENV}. I used full, absolute paths while running the example. I replaced the absolute paths in this comment for security purposes.

Any and all help would be appreciated. Thanks! :)

walidabualafia commented 11 months ago

This command works:

hint tl -m /path/to/data_1Mb.cool,/path/to/data_100kb.cool --chimeric /path/to/test_chimeric.sorted.pairsam.gz --refdir /path/to/refDir/hg19 --backdir /path/to/backgroundMatrices/hg19 --ppath /path/to/pairix -f cooler -g hg19 -n test -o /path/to/outputDir

This command fails with ValueError: row index exceeds matrix dimensions:

hint tl -m /path/to/4DNFICSTCJQZ.hic -f juicer --refdir /path/to/refData/hg38 --backdir /path/to/backgroundMatrices/hg38 -g hg38 -n 4DNFICSTCJQZ -c 0.05 --ppath /path/to/pairix -p 12 -o HiNTtransl_juicerOUTPUT