ay-lab / fithic

Fit-Hi-C is a tool for assigning statistical confidence estimates to chromosomal contact maps produced by genome-wide genome architecture assays such as Hi-C.
MIT License
79 stars 16 forks source link

list index out of range #54

Closed shenlinyong closed 2 years ago

shenlinyong commented 2 years ago

The following are the three input files:

$ zcat fat_5000.fithic.fragment.gz |head
NC_052532.1 0   2500    0   0
NC_052532.1 0   7500    0   0
NC_052532.1 0   12500   1106    1
NC_052532.1 0   17500   3828    1
NC_052532.1 0   22500   7946    1
NC_052532.1 0   27500   1786    1
NC_052532.1 0   32500   11554   1
NC_052532.1 0   37500   4999    1
NC_052532.1 0   42500   7694    1
NC_052532.1 0   47500   10932   1
zcat fat_5000.fithic.interaction.gz |head
NC_052532.1 12500   NC_052532.1 12500   113
NC_052532.1 12500   NC_052532.1 17500   15
NC_052532.1 12500   NC_052532.1 22500   4
NC_052532.1 12500   NC_052532.1 27500   1
NC_052532.1 12500   NC_052532.1 32500   1
NC_052532.1 12500   NC_052532.1 42500   1
NC_052532.1 12500   NC_052532.1 47500   5
NC_052532.1 12500   NC_052532.1 52500   2
NC_052532.1 12500   NC_052532.1 62500   2
NC_052532.1 12500   NC_052532.1 67500   3
zcat fat_5000.fithic.bias.gz|head
NC_052532.1 2500    0.447834
NC_052532.1 7500    0.098977
NC_052532.1 12500   0.150248
NC_052532.1 17500   0.374007
NC_052532.1 22500   0.563625
NC_052532.1 27500   0.239352
NC_052532.1 32500   0.588517
NC_052532.1 37500   0.492011
NC_052532.1 42500   0.661867
NC_052532.1 47500   0.819888

And the following are my error reporting messages:

GIVEN FIT-HI-C ARGUMENTS
=========================
Reading fragments file from: /home/SLY68/2022/hic/juicer/down_analysis/raw/fit-hic2/fat_5000.fithic.fragment.gz
Reading interactions file from: /home/SLY68/2022/hic/juicer/down_analysis/raw/fit-hic2/fat_5000.fithic.interaction.gz
Output path created ./interOnly/
Fixed size option detected... Fast version of FitHiC will be used
Resolution is 5.0 kb
Reading bias file from: /home/SLY68/2022/hic/juicer/down_analysis/raw/fit-hic2/fat_5000.fithic.bias.gz
The number of spline passes is 2
The number of bins is 100
The number of reads required to consider an interaction is 1
The name of the library for outputted files will be FitHiC
Upper Distance threshold is inf
Lower Distance threshold is 0
Graphs will be outputted
Only inter-chromosomal regions will be analyzed
Lower bound of bias values is 0.5
Upper bound of bias values is 2
All arguments processed. Running FitHiC now...
=========================

Reading the contact counts file to generate bins...
Interactions file read. Time took 2983.205014705658
Fragments file read. Time took 0.9499287605285645
Traceback (most recent call last):
  File "/home/SLY68/anaconda3/envs/hicpro/bin/fithic", line 8, in <module>
    sys.exit(main())
  File "/home/SLY68/anaconda3/envs/hicpro/lib/python3.7/site-packages/fithic/fithic.py", line 327, in main
    biasDic = read_biases(biasFile)
  File "/home/SLY68/anaconda3/envs/hicpro/lib/python3.7/site-packages/fithic/fithic.py", line 808, in read_biases
    chrom=words[0]; midPoint=int(words[1]); bias=float(words[2])
IndexError: list index out of range
ay-lab commented 2 years ago

there seems to be truncated line or something similar in your biases file. a line that has less than 3 fields.

ghost commented 1 year ago

Apparently, half of the bias file (from hicpro2fithic.py) was empty lines. after removing them the error went away.