Skip to content

Commit

Permalink
Fix realStart
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Feb 13, 2021
1 parent 2edd30d commit ebcbfa6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions plugins/dotplot-view/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export default class DotplotPlugin extends Plugin {
const saLengthSansClipping = getLengthSansClipping(saCigar)
const saStrandNormalized = saStrand === '-' ? -1 : 1
const saClipPos = getClip(saCigar, saStrandNormalized)
const saRealStart = +saStart - 1 + saClipPos
const saRealStart = +saStart - 1
return {
refName: saRef,
start: saRealStart,
Expand All @@ -217,9 +217,10 @@ export default class DotplotPlugin extends Plugin {
end: clipPos + getLengthSansClipping(cigar),
}

// if secondary alignment or supplementary, calculate length from SA[0]'s CIGAR
// which is the primary alignments. otherwise it is the primary alignment just use
// seq.length if primary alignment
// if secondary alignment or supplementary, calculate length
// from SA[0]'s CIGAR which is the primary alignments.
// otherwise it is the primary alignment just use seq.length if
// primary alignment
const totalLength =
// eslint-disable-next-line no-bitwise
flags & 2048
Expand Down
2 changes: 1 addition & 1 deletion plugins/linear-comparative-view/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ function WindowSizeDlg(props: {
const saLengthSansClipping = getLengthSansClipping(saCigar)
const saStrandNormalized = saStrand === '-' ? -1 : 1
const saClipPos = getClip(saCigar, saStrandNormalized)
const saRealStart = +saStart - 1 + saClipPos
const saRealStart = +saStart - 1
return {
refName: saRef,
start: saRealStart,
Expand Down

0 comments on commit ebcbfa6

Please sign in to comment.