TAD calling with HiCExplorer - TypeError in hicFindTADs TAD_score
2
0
Entering edit mode
7.3 years ago
mzuer • 0

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'
hicexplorer • 3.0k views
ADD COMMENT
1
Entering edit mode

This is strange. Can you tell us which version of HiCExplorer are you using. Can you run hicMergeBinsto reduce the size of the matrix and try to plot it using hicPlotMatrix. This is to check that the chromosomes are properly encoded in HiCExplorer matrix object.

ADD REPLY
0
Entering edit mode

This looks like a bug, but I've asked two of the developers to have a look.

ADD REPLY
0
Entering edit mode
7.3 years ago
al • 0

One possibility - this error can happen if there are multiple chromosomes represented in the data but the matrix does not represent the full chromosome length for subsequent chromosomes. You could try filling the missing rows and columns with zeros.

ADD COMMENT
0
Entering edit mode
7.3 years ago
mzuer • 0

Thank you for all your replies.

After further investigations, I noticed that the error might be caused by the index used for the header in the "Dekker" format (0- vs. 1-based genomic position). This "bug" is now reported here: https://github.com/maxplanck-ie/HiCExplorer/issues/118

ADD COMMENT
0
Entering edit mode

thanks for the report. We will look into that.

ADD REPLY

Login before adding your answer.

Traffic: 2140 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6