message: test: add tests for gene stripping
diff: @@ -61,3 +61,53 @@ TEST(extractGeneQuery, ExtractsQueryGene) {
  EXPECT_EQ(toString(gene_query), expected_gene_query);
  }
  +
  +
  +TEST(extractGeneQuery, ExtractsQueryGeneCorrectlyStripped) {
  + // clang-format off
  + // 6 18
  + // | | | | |
  + const std::string ref = "ATGTGA" "ATGAATGGCCCG" "AAAAAA";
  + const std::string query_aligned = "------" "-TGAATGGCC--" "------";
  + const std::string expected_gene_query = "NTGAATGGCCNN" ;
  + // clang-format on | | | | |
  +
  + const Gene gene = {
  + .geneName = "Hello",
  + .start = 6,
  + .end = 18,
  + .strand = "+",
  + .frame = 0,
  + .length = 12,
  + };
  +
  + const auto coordMap = mapCoordinates(toNucleotideSequence(ref));
  + const auto gene_query = NucleotideSequence(extractGeneQuery(toNucleotideSequence(query_aligned), gene, coordMap));
  +
  + EXPECT_EQ(toString(gene_query), expected_gene_query);
  +}
  +
  +TEST(extractGeneQuery, ExtractsQueryGeneCorrectlyStrippedWithGaps) {
  + // clang-format off
  + // 6 18
  + // | | | | |
  + const std::string ref = "ATGTGA" "ATGAATGGCCCG" "AAAAAA";
  + const std::string query_aligned = "------" "-T---TGGCC--" "------";
  + const std::string expected_gene_query = "NT" "TGGCCNN" ;
  + // clang-format on | | | | |
  +
  + const Gene gene = {
  + .geneName = "Hello",
  + .start = 6,
  + .end = 18,
  + .strand = "+",
  + .frame = 0,
  + .length = 12,
  + };
  +
  + const auto coordMap = mapCoordinates(toNucleotideSequence(ref));
  + const auto gene_query = NucleotideSequence(extractGeneQuery(toNucleotideSequence(query_aligned), gene, coordMap));
  +
  + EXPECT_EQ(toString(gene_query), expected_gene_query);
  +}
  +
  