4dn-dcic / hic2cool

Lightweight converter between hic and cool contact matrices.
MIT License
66 stars 7 forks source link

Error converting hic file #8

Closed pkerpedjiev closed 7 years ago

pkerpedjiev commented 7 years ago

The HiC file can be downloaded from here:

ftp://ftp.ncbi.nlm.nih.gov/geo/samples/GSM2358nnn/GSM2358971/suppl/GSM2358971_Kc167primary.hic.gz

The error is here:

################
### hic2cool ###
################
hic file header info:
Chromosomes:  ['All', 'chr2L', 'chr2LHet', 'chr2RHet', 'chr2R', 'chr3L', 'chr3LHet', 'chr3RHet', 'chr3R', 'chrX', 'chrXHet', 'chr4', 'chrYHet', 'chrM', 'chrU', 'chrUextra']
Resolutions:  [2500000, 1000000, 500000, 250000, 100000, 50000, 25000, 10000, 5000, 2000, 1000, 500]
Genome:  /scratch/PI/kornberg/keagen/referencegenomes/fly/dm3/dm3.chrom.sizes
Traceback (most recent call last):
  File "/Users/peter/miniconda3/envs/cenv3/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/Users/peter/miniconda3/envs/cenv3/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/Users/peter/projects/hic2cool/hic2cool/__main__.py", line 50, in <module>
    main()
  File "/Users/peter/projects/hic2cool/hic2cool/__main__.py", line 46, in main
    args.normalization, args.exclude_MT, True)
  File "/Users/peter/projects/hic2cool/hic2cool/hic2cool_utils.py", line 750, in hic2cool_convert
    req, masteridx, norm, unit, binsize)
  File "/Users/peter/projects/hic2cool/hic2cool/hic2cool_utils.py", line 127, in read_footer
    v = struct.unpack('<d', req.read(8))[0]
struct.error: unpack requires a bytes object of length 8
       79.73 real        74.12 user         2.25 sys
carlvitzthum commented 7 years ago

This issue was due to a faulty file on GEO.