Repository navigation
fix(align): write multimappers in STAR's window order, primary is trBest - #321
Closed
BenjaminDEMAILLE wants to merge 2 commits into
Closed
BenjaminDEMAILLE wants to merge 2 commits into
BenjaminDEMAILLE wants to merge 2 commits into
Conversation
STAR (2.7.2a and 2.7.11b alike) writes a multimapper's alignments in trMult order (window order) and flags trBest as the primary: the best score, then the shortest genomic span, then the first window (ReadAlign_stitchPieces.cpp, ReadAlign_multMapSelect.cpp). The primary is not always HI:1. With --outSAMmultNmax set, the best-scoring alignments are swapped to the top in window order and the first one is the primary. rustar sorted the alignments by score, junction count and coordinate, so the HI order and the primary differed from STAR on most human multimappers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
|
Closed by #326 (A1) |
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.
Summary
STAR writes a multimapper's alignments in
trMultorder (the window order) and flagstrBestas the primary: the best score, then the shortest genomic span, then the first window (ReadAlign_stitchPieces.cpp,ReadAlign_multMapSelect.cpp, default--outMultimapperOrder Old_2.4). The primary is therefore not alwaysHI:1. With--outSAMmultNmaxset, STAR first swaps the best-scoring alignments to the top (in window order) and the first one is the primary.rustar sorted the alignments by score, junction count and coordinate. The set of alignments was right, but the
HIorder and the choice of primary differed from STAR on many multimappers (the NH-aware parity check counted these as ties, so they did not show).This PR:
star_mult_map_order(SE and PE): score range, then STAR's order and primary;star_orderbecomes the rank in STAR's output order, the primary stays at index 0 for the downstream consumers (filters, stats, Solo);star_order, withHIfrom that order and the SECONDARY flag on every alignment but the primary;--outMultimapperOrder Randompath as it was.Stacked on #315 (it uses the
star_orderrank that PR introduces).Measured
Record for record (flag, position, MAPQ, CIGAR, mate fields,
NH,HI,AS,nM, in output order) against STAR 2.7.11b:Human (GRCh38-2024-A index, 19,556 multimapping reads from pbmc_1k_v3): STAR 2.7.11b and STAR 2.7.2a give the same output; rustar now matches 19,555 of them (1,585 before). The one left has its two alignments in the same window, recorded in a different order.
Test plan
cargo test --release,cargo clippy --all-targets -D warnings,cargo fmt --check.--outSAMmultNmaxswap.🤖 Generated with Claude Code