Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove file length check pt 2. #148

Merged
merged 2 commits into from
Dec 19, 2024
Merged

Remove file length check pt 2. #148

merged 2 commits into from
Dec 19, 2024

Conversation

cmdcolin
Copy link
Contributor

currently, cram-js tries to access the "file size" but this requires special CORS configurations when accessing cross origin files that not all servers have

I determined that a major contributor to the "need" for file length check was a "test only" method called containerCount. while it containerCount could potentially be used by people outside of our tests, it is uncommon for web usage. threfore, i found a way to fix it where it just catches an error reading past the end of the file with a try/catch

random note: one of the tricky files to handle corectly with this PR was "test/data/grc37-1#HG03297.mapped.ILLUMINA.bwa.ESN.low_coverage.20130415.bam.cram"

I found that it was referencing 'mate records' that were undefined. this was maybe due to performing samtools view on a slice of the file, which resulted in it referring to mates in other slices. potentially it could be investigated further, but this PR has 100% matching snapshots still.

this PR does propagate some "undefined's" (where ::decode() can return undefined now) through the type system, related to where that decode can fail, related to what i hypothesize is that mate record not being defined, but the type system checks this edge case well and so it is accomodated by some basic workarounds for that undefined condition.

this is a re-attempt at #131

@cmdcolin cmdcolin merged commit 08098e1 into master Dec 19, 2024
1 check passed
@cmdcolin cmdcolin deleted the nostat branch December 19, 2024 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant