Skip to content

bamCompare: keep bin coordinates after a --skipZeroOverZero gap - #1449

Open
cindykrafft wants to merge 1 commit into
deeptools:masterfrom
cindykrafft:fix/bamcompare-skipzerooverzero-coordinates
Open

bamCompare: keep bin coordinates after a --skipZeroOverZero gap#1449
cindykrafft wants to merge 1 commit into
deeptools:masterfrom
cindykrafft:fix/bamcompare-skipzerooverzero-coordinates

Conversation

@cindykrafft

Copy link
Copy Markdown

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, and a skipped bin between two equal values was merged into the run (#1108, #1130). The bigWig-input loop in writeBedGraph_bam_and_bw.py already 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/writeEnd are initialised before the loop.

Test: test_bam_compare_ZoverZ_interior_bins runs --operation first --skipZeroOverZero on test_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 on master (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 unmodified master); flake8 with 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


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)
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.

bamCompare --skipZeroOverZero has incorrect coordinates

1 participant