Repository navigation
Fix reading of big-endian bigWig files - #2115
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
igv.js can't read big-endian bigWig files (#786). When the magic number doesn't match little-endian,
BWReader.loadHeaderre-reads it big-endian, which yields the same value as a little-endian file, but compares it againstBIGWIG_MAGIC_HTL, which is both the wrong constant to use there and mistyped (0x26FC8F66rather than0x26FC8F88). So the file's type is never set. Once that is fixed, the wig and zoom decoders still read big-endian blocks as little-endian, because they take alittleEndianargument that is never passed; they now usethis.littleEndian, as the bigBed decoder already does. The unused_HTLconstants are removed. The magic-number fix also applies to big-endian bigBed files, which I haven't tested separately.The new test in
testBigwig.jsreads raw and zoom data fromtest/data/bb/bigEndian.bw(1,040 bytes). kent's tools only write the host's byte order, so the file was written with bigwig-rs, whose interop tests found this bug; kent'sbigWigInfoandbigWigToBedGraphread it correctly.npm testpasses.Program that wrote the test file (bigwig-rs
8898bbc)