igvteam / hic-straw

Command line and web utilities for reading .hic contact matrix files
MIT License
8 stars 4 forks source link

File with header larger than 64,000 bytes produces error #17

Closed cmdcolin closed 3 years ago

cmdcolin commented 3 years ago

Hi there We had a user of jbrowse 2 report that they got an error opening a hic file with a "RangeError: Out of bounds access" which appears to be due to reading a file that might have many scaffolds or something that makes it have a header that exceeds the boundary of 64000

I see in the source code it might make the assumption that the header can be obtained in a single fetch of 64000. It might need to do a larger fetch or perhaps re-fetch if it determines that the file is larger than that

jrobinso commented 3 years ago

OK, yes, I see that as well. Is it possible to share a link to that file? If not maybe I can simulate the situation.

There might be other issues with a hic file with that many scaffolds, I really don't know its not something I had in mind when I designed this. The absolute size of the file (10GB) is not relevant.

cmdcolin commented 3 years ago

Sent over an email

jrobinso commented 3 years ago

This is fixed, npm version is 2.0.2.