Repository navigation
fix: make outputs independent of hash order and --threads - #205
Merged
Merged
Conversation
Several outputs changed between runs, or between thread counts, because they depended on HashMap iteration order or on how chromosomes were split across workers. Thread count (per-chromosome workers merged in a different order): - inner_distance: pairs were concatenated in worker order and cut at the sample size, and the distance list was cut at the same length as the pair list although it has no entries for cross-chromosome pairs. Pairs are now merged in chromosome order, cut, and the distances rebuilt from the kept pairs. Each worker's chromosome batch is now in ascending order so its own cut keeps the right pairs. - dupRadar/featureCounts mate pairing: the merge took the duplicate and multi-mapper flags of whichever mate the first worker held, and a repeated mate key (no HI tag, duplicated records) overwrote the waiting mate, so reads were dropped differently depending on the split. Mates now wait in a per-key FIFO queue that pairs read1 with read2 in arrival order, giving the same pairs in one pass or after a merge, and a fragment counts as duplicate / multi-mapped if either mate is, as featureCounts does (Rsubread readSummary.c, loop over both ends in process_pairer_output). Hash order: - dupRadar density scatter: pixels with equal density are now drawn in pixel order, so the SVG/PNG no longer change from run to run. - chromosome_mapping: two GTF names mapped to one alignment name made the reverse lookup pick one at random. Such a config is now rejected at load time with a clear error. - The chromosome-mismatch error listed 5 random GTF chromosomes; it now lists the first 5 in GTF order. - Qualimap COLLISION debug lines are printed in ascending mean order. - MergedGeneCoverage::iter yields genes in index order. The Qualimap unmapped-segment reads are now looked up by their GTF chromosome name, like every other read. Single-threaded output is unchanged on the benchmark datasets; the parallel path now reproduces it byte for byte. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Some outputs changed between runs or between
--threadsvalues because they relied on hash-map order or on how chromosomes were split across workers.chromosome_mappingthat sends two GTF names to one alignment name is now rejected when the config loads.Single-thread output is unchanged on 8 public datasets, and
--threads 1/2/6now give identical files apart from timestamps.🤖 Generated with Claude Code