nservant / HiC-Pro

HiC-Pro: An optimized and flexible pipeline for Hi-C data processing
Other
386 stars 182 forks source link

sparseToDense.py error #379

Closed Ferossitiziano closed 3 years ago

Ferossitiziano commented 4 years ago

Hey,

I am trying to convert my ice-normalised matrix KO_1000000_iced.matrix into a dense matrix using the command

python sparseToDense.py hic_results/matrix/KO/iced/1000000/KO_1000000_iced.matrix -o dense.matrix.test

and I get the following error:


/hpcnfs/home/ieo5073/.local/lib/python2.7/site-packages/iced/io/_io_pandas.py:32: FutureWarning: Method .as_matrix will be removed in a future version. Use .values instead.
  row, col, data = dataframe.as_matrix().T
Traceback (most recent call last):
  File "/hpcnfs/home/ieo5073/miniconda3/envs/HiCpro/bin/HiC-Pro_2.11.4/bin/utils/sparseToDense.py", line 83, in <module>
    counts = io.load_counts(args.filename, lengths=lengths)
  File "/hpcnfs/home/ieo5073/.local/lib/python2.7/site-packages/iced/io/_io_pandas.py", line 59, in load_counts
    counts = sparse.coo_matrix((data, (row, col)), shape=shape)
  File "/hpcnfs/home/ieo5073/miniconda3/envs/HiCpro/lib/python2.7/site-packages/scipy/sparse/coo.py", line 154, in __init__
    self._shape = check_shape((M, N))
  File "/hpcnfs/home/ieo5073/miniconda3/envs/HiCpro/lib/python2.7/site-packages/scipy/sparse/sputils.py", line 279, in check_shape
    new_shape = tuple(operator.index(arg) for arg in args)
  File "/hpcnfs/home/ieo5073/miniconda3/envs/HiCpro/lib/python2.7/site-packages/scipy/sparse/sputils.py", line 279, in <genexpr>
    new_shape = tuple(operator.index(arg) for arg in args)
TypeError: 'numpy.float64' object cannot be interpreted as an index

I have tried using matrixes at different resolution and also to used the non ice-normalised matrix but I had no luck. Do you have any advice?

thank you,

Federico

nservant commented 3 years ago

Hi Frederico Which HiC-Pro version are you using please ? I'll try to reproduce the issue. Thanks