Skip to content

Commit

Permalink
suggested fix to handle RCs in opt.runs + minor change in the test
Browse files Browse the repository at this point in the history
  • Loading branch information
PavelVesely committed Feb 12, 2024
1 parent 88b9e8f commit 9e8919a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@ std::pair<size_t, size_t> ReadIntervals(kh_O64_t *intervals, kh_S64_t *kMers, st
--beforeKMerEnd;
if (beforeKMerEnd == 0) {
bool represented = kh_get_S64(kMers, currentKMer) != kh_end(kMers);
if (!represented && complements) {
auto rc = ReverseComplement(currentKMer, k);
represented = kh_get_S64(kMers, rc) != kh_end(kMers);
}
bool set = false;
if (represented) {
interval_used = true;
Expand Down
2 changes: 1 addition & 1 deletion tests/masks_unittest.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ namespace {

TEST(Mask, OptimizeRuns2) {
std::string path = std::filesystem::current_path();
path += "/tests/testdata/runstest2.fa"; // ACTaGta
path += "/tests/testdata/runstest2.fa"; // ACtaGta

struct TestCase {
std::vector<kmer_t> kMers;
Expand Down
2 changes: 1 addition & 1 deletion tests/testdata/runstest2.fa
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
> superstring
ACTaGta
ACtaGta

0 comments on commit 9e8919a

Please sign in to comment.