message: fix: corect the nuc position calculation relative to gene start
diff: @@ -37,13 +37,12 @@ export function reconstructGeneSequences(
  const { pos, queryNuc } = mut
  if (inRange(pos, gene.range)) {
  - const genePos = geneBegin - pos // Position relative to the gene start
  -
  - // TODO: invariant(genePos > 0)
  - // TODO: invariant(genePos < queryGene.length)
  + const genePos = pos - geneBegin // Position relative to the gene start
  + if (genePos >= 0 && genePos < queryGene.length) {
  queryGene[genePos] = queryNuc
  }
  }
  + }
  for (const del of deletions) {
  const { start: delBegin, length: delLength } = del
  @@ -59,12 +58,12 @@ export function reconstructGeneSequences(
  // Fill deletion range with gaps
  for (let pos = begin; pos < end; ++pos) {
  - const genePos = geneBegin - pos // Position relative to the gene start
  - // TODO: invariant(genePos > 0)
  - // TODO: invariant(genePos < queryGene.length)
  + const genePos = pos - geneBegin // Position relative to the gene start
  + if (genePos >= 0 && genePos < queryGene.length) {
  queryGene[genePos] = AMINOACID_GAP
  }
  }
  + }
  // TODO: postcondition(isDivisibleBy(queryGene.length, 3))
  // TODO: postcondition(refGene.length, initialLength))
  