Skip to content

Commit

Permalink
Fix MM tag modifications from particular BAM file failing to render o…
Browse files Browse the repository at this point in the history
…n the negative strand (#4630)
  • Loading branch information
cmdcolin authored Oct 31, 2024
1 parent 03f6b7d commit 52ef2a8
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions plugins/alignments/src/MismatchParser/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,13 +351,18 @@ export function getModificationPositions(
}
i++
} while (delta >= 0 && i < seq.length)

const temp = i - 1
positions.push(fstrand === -1 ? seq.length - 1 - temp : temp)
}
if (fstrand === -1) {
positions.sort((a, b) => a - b)
if (fstrand === -1) {
const pos = seq.length - i
if (pos >= 0) {
// avoid negative-number-positions in array, seen in #4629 cause
// unknown, could warrant some further investigation
positions.unshift(pos)
}
} else {
positions.push(i - 1)
}
}

result.push({
type,
positions,
Expand Down

0 comments on commit 52ef2a8

Please sign in to comment.