Dear all, I am trying to use HiCExplorer for calling TADs, but I encounter the following issue. I have a Hi-C matrix in Dekker's format, I first convert it into npz format using hicExport
hicExport -in HiC_matrix_colrow.txt.gz -o out_test_50.npz --inputFormat=dekker --outputFormat=npz
this works perfectly, but then I try to calculate the scores (with different parameters, here below just an example)
hicFindTADs TAD_score -m out_test_50.npz --minDepth 150000 --maxDepth 300000 --step 50000 -o out_test_score_50
the function hic_matrix.getRegionBinRange(chrom, left_start, left_start + 1)[0] raises the following error:
TypeError: 'NoneType' object has no attribute 'getitem'
do you have any idea of what can cause this error ??
thank you in advance
here below is the entire output:
INFO:hicFindTADs:removing diagonal values
binsize: 50000
command: TAD_score
matrix: out_test_50.npz
maxDepth: 300000
minDepth: 150000
numberOfProcessors: 1
outFileName: out_test_score_50
step: 50000
INFO:hicFindTADs:Computing z-score matrix...
processing chromosome chr6
WARNING File already exists out_test_score_50_zscore_matrix.h5
Overwriting ...
INFO:hicFindTADs:Computing TAD-separation scores...
INFO:hicFindTADs:computing spectrum for window sizes between 3 (150000 bp)and 6 (300000 bp) at the following window sizes 1 [150000, 200000, 291421]
Traceback (most recent call last):
File "/home/user/.local/bin/hicFindTADs", line 7, in
main()
File "/home/user/.local/lib/python2.7/site-packages/hicexplorer/hicFindTADs.py", line 1202, in main
chrom, chr_start, chr_end, matrix = compute_spectra_matrix(args)
File "/home/user/.local/lib/python2.7/site-packages/hicexplorer/hicFindTADs.py", line 1013, in compute_spectra_matrix
res = map(func, TASKS)
File "/home/user/.local/lib/python2.7/site-packages/hicexplorer/hicFindTADs.py", line 255, in compute_matrix_wrapper
return compute_matrix(*args)
File "/home/user/.local/lib/python2.7/site-packages/hicexplorer/hicFindTADs.py", line 299, in compute_matrix
mult_matrix = [get_cut_weight(hic_ma, cut, depth, return_mean=True) for depth in incremental_step]
File "/home/user/.local/lib/python2.7/site-packages/hicexplorer/hicFindTADs.py", line 222, in get_cut_weight
left_idx, right_idx = get_idx_of_bins_at_given_distance(hic_matrix, cut, window_len)
File "/home/user/.local/lib/python2.7/site-packages/hicexplorer/hicFindTADs.py", line 204, in get_idx_of_bins_at_given_distance
left_idx = hic_matrix.getRegionBinRange(chrom, left_start, left_start + 1)[0]
TypeError: 'NoneType' object has no attribute 'getitem'
This is strange. Can you tell us which version of HiCExplorer are you using. Can you run
hicMergeBins
to reduce the size of the matrix and try to plot it usinghicPlotMatrix
. This is to check that the chromosomes are properly encoded in HiCExplorer matrix object.This looks like a bug, but I've asked two of the developers to have a look.