Skip to content

Commit

Permalink
Merge branch 'smalton/DOR-938-trimmed-modtags' into 'master'
Browse files Browse the repository at this point in the history
[DOR-938] Invalid modtag

Closes DOR-938

See merge request machine-learning/dorado!1283
  • Loading branch information
MarkBicknellONT committed Nov 26, 2024
2 parents c397f72 + 4d37ddd commit afdb068
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 0 additions & 3 deletions dorado/torch_utils/trim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,6 @@ std::tuple<std::string, std::vector<uint8_t>> trim_modbase_info(
}
mod.remove_prefix(std::min(comma_pos + 1, mod.length())); // No comma at the end.
}
if (counts.str().empty()) {
counts << ",";
}
trimmed_modbase_str << std::string(prefix) << counts.str() << ";";
}
}
Expand Down
4 changes: 2 additions & 2 deletions tests/TrimTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,14 @@ TEST_CASE("Test trim mod base info", TEST_GROUP) {
// the second mod is eliminated
// in the third mod, first base position changes and the last is dropped
auto [str, probs] = utils::trim_modbase_info(seq, modbase_str, modbase_probs, {3, 18});
CHECK(str == "A+a?,0,0;C+m?,;T+x?,1;");
CHECK(str == "A+a?,0,0;C+m?;T+x?,1;");
const std::vector<uint8_t> expected = {2, 3, 20};
CHECK_THAT(probs, Equals(expected));
}

SECTION("Trim whole sequence") {
auto [str, probs] = utils::trim_modbase_info(seq, modbase_str, modbase_probs, {8, 8});
CHECK(str == "A+a?,;C+m?,;T+x?,;");
CHECK(str == "A+a?;C+m?;T+x?;");
CHECK(probs.size() == 0);
}
}
Expand Down

0 comments on commit afdb068

Please sign in to comment.