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

hic ERROR:hicmatrix.HiCMatrix:Index error #846

Open raquelsofi opened 1 year ago

raquelsofi commented 1 year ago

Welcome to the HiCExplorer GitHub repository! Before opening the issue please check that the following requirements are met :

Retry your command, is it solved now? If not please continue with the following:

raquelsofi commented 1 year ago

Hi,

I'm running hicPCA with the extraTrack option to assign eigenvector signal based on gene density with this command:

hicPCA \ -m HiCExplorer_outputs/BCRpos_neg_5000/hicMergeMatrixBins/BCRpos_raw_200kb_normICEcorrected.h5 \ -o HiCExplorer_outputs/BCRpos_neg_5000/Compartments/BCRpos_raw_200kb_normICEcorrected_pca1_genecorrected.bedgraph HiCExplorer_outputs/BCRpos_neg_5000/Compartments/BCRpos_raw_200kb_normICEcorrected_pca2_genecorrected.bedgraph \ --format bedgraph \ --method dist_norm \ --extraTrack mm10newgenes_filtered_sorted.bed \ --pearsonMatrix HiCExplorer_outputs/BCRpos_neg_5000/Compartments/BCRpos_raw_200kb_normICEcorrected_pearsonMatrix_genecorrected.h5 \ --obsexpMatrix HiCExplorer_outputs/BCRpos_neg_5000/Compartments/BCRpos_raw_200kb_normICEcorrected_obsexpMatrix_genecorrected.h5

ERROR:hicmatrix.HiCMatrix:Index error Traceback (most recent call last): File "/storage/home/rsilva/anaconda3/envs/hicexplorer/lib/python3.8/site-packages/hicmatrix/HiCMatrix.py", line 271, in getRegionBinRange endbin = sorted(self.interval_trees[chrname][endpos:endpos + 1])[0].data IndexError: list index out of range Traceback (most recent call last): File "/storage/home/rsilva/anaconda3/envs/hicexplorer/bin/hicPCA", line 7, in main() File "/storage/home/rsilva/anaconda3/envs/hicexplorer/lib/python3.8/site-packages/hicexplorer/hicPCA.py", line 337, in main vecs_list = correlateEigenvectorWithGeneTrack(ma, vecs_list, args.extraTrack) File "/storage/home/rsilva/anaconda3/envs/hicexplorer/lib/python3.8/site-packages/hicexplorer/hicPCA.py", line 161, in correlateEigenvectorWithGeneTrack gene_occurrence[bin_id[1]] += 1 TypeError: 'NoneType' object is not subscriptable

I looked for this error before and found this issue in a hicAdjustmatrix

https://github.com/deeptools/HiCExplorer/issues/487

so I checked length of chr with the HicINFO and verified whether i had regions outside the values from bedfile

Matrix information file. Created with HiCExplorer's hicInfo version 3.6

File: HiCExplorer_outputs/BCRpos_neg_5000/hicMergeMatrixBins/BCRpos_raw_200kb_normICEcorrected.h5 Size: 13,170 Bin_length: 200000 Sum of matrix: 299607655.71638775 Chromosomes:length: chr1: 195400000 bp; chr2: 182113224 bp; chr3: 160000000 bp; chr4: 156508116 bp; chr5: 151800000 bp; chr6: 149736546 bp; chr7: 145400000 bp; chr8: 129400000 bp; chr9: 124595110 bp; chr10: 130600000 bp; chr11: 122000000 bp; chr12: 120129022 bp; chr13: 120400000 bp; chr14: 124902244 bp; chr15: 104000000 bp; chr16: 98200000 bp; chr17: 94987271 bp; chr18: 90702639 bp; chr19: 61431566 bp; chrX: 171000000 bp; Non-zero elements: 55,740,966 Minimum (non zero): 0.43227997314619343 Maximum: 29325.658140330415 NaN bins: 720

I confirmed there are no values in the bed file outside the values of the matrix

awk '{split($1, a, "_"); chr=a[1]; pos=$3} $1!=prev {if (NR>1) print prev_chr, prev_pos; prev=$1; prev_chr=chr} {prev_pos=pos} END {print prev_chr, prev_pos}' mm10newgenes_filtered_sorted.bed

chr1 195176715 chr10 130497379 chr11 121843436 chr12 120021245 chr13 120318261 chr14 124015684 chr15 103899312 chr16 98082439 chr17 94878321 chr18 90543267 chr19 61228418 chr2 182001087 chr3 159935175 chr4 156339496 chr5 151651208 chr6 149563326 chr7 145324059 chr8 129234046 chr9 124476862 chrX 170678054

I'm using conda environment with version hicexplorer 3.6

Any ideas what could be causing this issue?

Many thanks for your support, Raquel