Skip to content

Commit

Permalink
More phase offset for genome to msa
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Oct 31, 2023
1 parent 742c0c8 commit 0fbfa5d
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/MsaView/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,18 +122,16 @@ export default function stateModelFactory() {
refName,
proteinStart,
proteinEnd,
phase,
} = entry
const c = hoverPosition.coord - 1
if (
refName === hoverPosition.refName &&
doesIntersect2(
featureStart,
featureEnd,
hoverPosition.coord,
hoverPosition.coord + 1,
)
doesIntersect2(featureStart, featureEnd, c, c + 1)
) {
const ret = (hoverPosition.coord - featureStart) / 3
return Math.floor(ret)
const phaseOffset = (3 - phase) % 3
const ret = (c - featureStart + phaseOffset) / 3
return Math.floor(ret + proteinStart) + 1
}
}
return undefined
Expand Down

0 comments on commit 0fbfa5d

Please sign in to comment.