message: fix(algo): ensure aa context is properly complemented
diff: use crate::analyze::aa_del::AaDelMinimal;
  use crate::analyze::aa_sub::AaSubMinimal;
  -use crate::gene::gene::Gene;
  -use crate::io::gene_map::GeneMap;
  +use crate::gene::gene::{Gene, GeneStrand};
  use crate::io::aa::{from_aa, Aa};
  +use crate::io::gene_map::GeneMap;
  use crate::io::letter::Letter;
  use crate::io::nuc::{from_nuc_seq, Nuc};
  use crate::make_internal_report;
  +use crate::translate::complement::reverse_complement_in_place;
  use crate::translate::translate_genes::{Translation, TranslationMap};
  use crate::utils::error::keep_ok;
  use crate::utils::range::Range;
  @@ -217,7 +218,11 @@ fn find_aa_changes_for_gene(
  let qry_aa = qry_peptide[codon];
  // Find where the codon is in nucleotide sequences
  - let codon_begin = gene.start + codon * 3;
  + let codon_begin = if gene.strand != GeneStrand::Reverse {
  + gene.start + codon * 3
  + } else {
  + gene.end - (codon + 1) * 3
  + };
  let codon_end = codon_begin + 3;
  // If the codon is outside of nucleotide alignment, there is nothing to do
  @@ -228,8 +233,12 @@ fn find_aa_changes_for_gene(
  // Provide surrounding context in nucleotide sequences: 1 codon to the left and 1 codon to the right
  let context_begin = clamp(codon_begin - 3, 0, num_nucs);
  let context_end = clamp(codon_end + 3, 0, num_nucs);
  - let ref_context = from_nuc_seq(&ref_seq[context_begin..context_end]);
  - let query_context = from_nuc_seq(&qry_seq[context_begin..context_end]);
  + let mut ref_context = (&ref_seq[context_begin..context_end]).to_vec();
  + let mut query_context = (&qry_seq[context_begin..context_end]).to_vec();
  + if gene.strand == GeneStrand::Reverse {
  + reverse_complement_in_place(&mut ref_context);
  + reverse_complement_in_place(&mut query_context);
  + }
  let codon_nuc_range = Range {
  begin: codon_begin,
  @@ -248,8 +257,8 @@ fn find_aa_changes_for_gene(
  reff: ref_aa,
  pos: codon,
  codon_nuc_range,
  - ref_context,
  - query_context,
  + ref_context: from_nuc_seq(&ref_context),
  + query_context: from_nuc_seq(&query_context),
  context_nuc_range,
  });
  }
  @@ -262,8 +271,8 @@ fn find_aa_changes_for_gene(
  pos: codon,
  qry: qry_aa,
  codon_nuc_range,
  - ref_context,
  - query_context,
  + ref_context: from_nuc_seq(&ref_context),
  + query_context: from_nuc_seq(&query_context),
  context_nuc_range,
  });
  }
  