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

hicAggregateContacts: list index out of range #825

Closed Lucas446 closed 1 year ago

Lucas446 commented 1 year ago

Hi,

I am using HiCexplorer hicAggregateContacts function to get the contacts between a set of genomic positions (.bed file).

head of my bed file:

chr3R 11371536 11373001 chr3R 16249423 16250737 chr3R 30911966 30912930 chr3R 16811677 16812290 chr3R 8181381 8182042 chr3R 7000639 7001267 chr3R 7037218 7037914 chr3R 16899483 16900033 chr3R 16829995 16830605 chr3R 4852336 4852868

first line of the validPair.bam:

NB551631:263:HTCJYAFX3:1:11101:17094:1026 81 chr3R 17458342 60 4S71M chr3L 8205337 0 TGATCGATCTCAACGAAGCATTCATATCGATATGCAGCCAGTATTAAATGCAATTTATGCAAATTTTTGNCATCA E/<EEAEAEEE/EEEEA/A/EEEAEE6EEEEE/EEEEEE/EE//EE//EEAE/EEEAEE/E///EE/EE#AAA/A NM:i:1 MD:Z:65C5 AS:i:69 XS:i:0

HiCexplorer command for hicAggregateContacts:

hicAggregateContacts -m ${FILE} --outFileName norm_smallest_esc_CyO_St10_St14cat_st10_25000bp_norm_ICE_autoCorr --BED ${BED} --mode ${MODE[1]} --range ${RANGE} --numberOfBins ${NUMBERofBINS} --transform ${TRAN[2]} --operationType ${OPTYPE[1]} --largeRegionsOperation ${LRO[0]} --outFilePrefixMatrix norm_smallest_esc_CyO_St10_St14cat_st10_25000bp_norm_ICE_autoCorr --outFileContactPairs ContactPairs --outFileObsExp FileObsExp --diagnosticHeatmapFile diagnosticHeatmapFile --chromosomes chr3R

The h5 resolution is 5000bp RANGE="300000:1000000" NUMBERofBINS=30

Here is the error I get:

Traceback (most recent call last): File "/opt/miniconda3/envs/HiCexplorer_env/bin/hicAggregateContacts", line 7, in main() File "/opt/miniconda3/envs/HiCexplorer_env/lib/python3.9/site-packages/hicexplorer/hicAggregateContacts.py", line 915, in main bed_intervals = read_bed_per_chrom(args.BED, chrom_list, args.considerStrandDirection) File "/opt/miniconda3/envs/HiCexplorer_env/lib/python3.9/site-packages/hicexplorer/hicAggregateContacts.py", line 254, in read_bed_per_chrom if fields[0] not in chrom_list: IndexError: list index out of range

I don't understand what is wrong,

Thanks for your help, Best, Tanguy

lldelisle commented 1 year ago

Hi, You may have an empty line in your file. Could you do a tail of your bed file? Thanks

Lucas446 commented 1 year ago

Hi Lucille,

Thanks a lot for your reply, that was actually this issue :)

Best, Tanguy

Le ven. 4 nov. 2022 à 02:20, Lucille Delisle @.***> a écrit :

Hi, You may have an empty line in your file. Could you do a tail of your bed file? Thanks

— Reply to this email directly, view it on GitHub https://github.com/deeptools/HiCExplorer/issues/825#issuecomment-1303027379, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALDDXRSUZOAJMUPGEDQF6X3WGSTMTANCNFSM6AAAAAARWQ6B3I . You are receiving this because you authored the thread.Message ID: @.***>