Repository navigation
fix(chimeric): well-formed single-end WithinBAM records with STAR's hard-clip rules - #282
Open
BenjaminDEMAILLE wants to merge 1 commit into
Open
BenjaminDEMAILLE wants to merge 1 commit into
BenjaminDEMAILLE wants to merge 1 commit into
Conversation
…ip rules Soft-clip (Tier 1b) and residual (Tier 3) segments kept sub-sequence CIGARs, so a donor could carry 40M with a 100 bp SEQ and crash BAM output. CIGARs are now lifted to full-read orientation and padded, SE segments are ordered by read position, the representative follows STAR's chimRepresent, and the supplementary record is hard-clipped on its junction side (bamHardClip, SoftClip keeps soft clips). Also fixes Tier 1b clip side for reverse primaries and strand-aware segment ordering in Tiers 1b, 2 and 3. Closes #279 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
10 tasks
Merged
This branch has not been deployed
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.
Closes #279.
Root cause:
build_within_bam_recordsused each segment's CIGAR as is and gave the representative the full read SEQ. SE soft-clip re-mapping (Tier 1b) and residual re-seeding (Tier 3) re-align a sub-sequence and only shifted exon coordinates, so the CIGAR was never padded (e.g.40Mwith a 100 bp SEQ) and reverse-strand pieces got forward-read coordinates. Related bugs: Tiers 1b/2/3 ordered segments without accounting for strand, Tier 1b took the clip from the wrong end for a reverse primary, and Tier 3 then re-found a covered segment (duplicate chimera).Fix (checked against STAR
ChimericAlign_chimericBAMoutput.cpp,ReadAlign_alignBAM.cpp):full_length_cigar);lift_clip_transcriptmaps sub-sequence transcripts into full-read orientation.trChim), representative = strictly higher score else second (chimRepresent), supplementary hard-clipped on its junction side (itr%2==Str ? -12 : -11), SEQ trimmed accordingly.--chimOutType WithinBAM SoftClipkeeps soft clips (newchim_out_bam_hard_clip()).Chimeric.out.junctionfor affected SE reads.Tests: integration test
test_se_chim_within_bam_records_well_formed(HardClip and SoftClip; fails on main with the reported error), plus 4 unit tests. fmt, clippy 0 warnings, all suites green.Remaining STAR differences (not in this PR):
Tracking: #277
🤖 Generated with Claude Code