bamCompare: keep bin coordinates after a --skipZeroOverZero gap - #1449
Open
cindykrafft wants to merge 1 commit into
Open
bamCompare: keep bin coordinates after a --skipZeroOverZero gap#1449cindykrafft wants to merge 1 commit into
cindykrafft wants to merge 1 commit into
Conversation
writeBedGraph_worker derives the coordinates of every written interval from the end of the previous one, so a bin skipped by --skipZeroOverZero shifted all following intervals of the chunk one bin to the left (issues deeptools#1108, deeptools#1130). Flush the current run and restart from the next bin's own coordinate, as the bigWig-input implementation (writeBedGraph_bam_and_bw) already does. Found in a source-level correctness audit of research software (methods and harnesses: https://github.com/cindykrafft/research-software-audit/tree/main/audits/deeptools)
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.
bamCompare --skipZeroOverZerohas incorrect coordinates #1108 andbamCompare --skipZeroOverZerobugged #1130CHANGES.txtbullet onlywriteBedGraph_workerderives the coordinates of every written interval from the end of the previous one, so a bin skipped by--skipZeroOverZeroshifted all following intervals of the chunk one bin to the left, and a skipped bin between two equal values was merged into the run (#1108, #1130). The bigWig-input loop inwriteBedGraph_bam_and_bw.pyalready resets on the skip; this makes the BAM loop do the same (flush the current run, restart from the next bin's own coordinate).writeStart/writeEndare initialised before the loop.Test:
test_bam_compare_ZoverZ_interior_binsruns--operation first --skipZeroOverZeroontest_filtering.bam(a gap between positions 57 and 78, 10-bp bins) and compares with the bamCoverage track of the same file with its zero bins removed; fails onmaster(1 failed), passes with the patch.test_bamCoverage_and_bamCompare.py+ the multiBigwigSummary and countReadsPerBin modules: 54 passed; full suite 100 passed, 1 pre-existing failure (test_plotCoverage_default, also on unmodifiedmaster);flake8with the project's options clean.Found in a source-level correctness audit of research software (methods and harnesses: https://github.com/cindykrafft/research-software-audit/tree/main/audits/deeptools)
Generated by Claude Code