From 4f143dd2114e9b2467a210f93fed0c5f5cd37213 Mon Sep 17 00:00:00 2001 From: Chris Saunders Date: Mon, 16 Jul 2018 17:15:40 -0700 Subject: [PATCH] STREL-966 Fix RNA-seq realignment with mismatches RNA-Seq reads pinned to fixed start position by an intron-exon boundary, and containing a leading insertion, were being incorrectly processed when the reads also contained a mismatch, leading to an exception. Adding the read start position to the alignment processing step should fix the issue. --- CHANGELOG.md | 6 ++++++ src/c++/lib/starling_common/starling_read_align.cpp | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ccb4e95..e463d375 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## Unreleased + +### Fixed +- Fix realignment error when processing certain RNA-seq inputs (STREL-966) + - Recent changes to read realignment/scoring introduced an edge case which fails on RNA-Seq reads from certain aligners - specifically when an insertion immediately follows an intron gap. The issue is now fixed. + ## v2.9.5 - 2018-06-25 This is a minor bugfix update from v2.9.4. diff --git a/src/c++/lib/starling_common/starling_read_align.cpp b/src/c++/lib/starling_common/starling_read_align.cpp index 22cfac91..abfc9c38 100644 --- a/src/c++/lib/starling_common/starling_read_align.cpp +++ b/src/c++/lib/starling_common/starling_read_align.cpp @@ -1884,7 +1884,10 @@ getCandidateAlignments( } if (isRecomputeRequired) { - cal = make_start_pos_alignment(cal.al.pos, 0, cal.al.is_fwd_strand, rseg.read_size(), validIndels); + // Convert the input alignment path to differentiate sequence match (=) and mismatch (X) from + // 'alignment match' (M). This is required for mismatch processing to work correctly. + const pos_t readStartPos(unalignedPrefixSize(cal.al.path)); + cal = make_start_pos_alignment(cal.al.pos, readStartPos, cal.al.is_fwd_strand, rseg.read_size(), validIndels); } }