Repository navigation
Conversation
Temporarily remove the final coverage sentinel when writing D4 values, then restore it for subsequent output. Use the existing d4-nim writer without copying the depth array. Add a BAM-to-D4 regression using the existing HTSlib bindings.
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.
Hi Brent Pedersen,
I'm using the D4 format to inspect BAM coverage. I've also been building my own D4 file browser, d4-plot. It's vibe coding, though.
I initially used mosdepth to generate D4 files, but while porting the related code, I noticed problems with how the data was displayed. The attached image shows an example.
I then asked ChatGPT to audit the code, and it appeared there were several issues. I don't really understand the details myself. I considered opening issues and submitting fixes as pull requests, but the problems spanned multiple repositories, and it looked like a lot of work for someone like me who struggles with Rust and Nim.
In particular, development of d4-format doesn't seem very active at the moment. So I ended up porting several related libraries to Crystal, driven by an irrational desire to reinvent the wheel, my passion for Crystal, and foolish use of LLMs.
This pull request fixes one of the clearest issues found: depth values at the end being lost.
As a regression test, it generates a seven-base BAM with depths 127,128,254,255,256,257,5000 and checks the values read back from D4. The code was written by GPT-6.1 Sol through multiple rounds of revision.
Thanks you.
kojix2