Skip to content

Commit

Permalink
Merge branch 'mvella/fix-incorrect-dx-tag' into 'master'
Browse files Browse the repository at this point in the history
Fix incorrect dx tag

See merge request machine-learning/dorado!639
  • Loading branch information
tijyojwad committed Oct 10, 2023
2 parents c3e22c6 + 6c54109 commit 7fefd5d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dorado/read_pipeline/ReadPipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ std::vector<BamPtr> ReadCommon::extract_sam_lines(bool emit_moves,
if (is_duplex) {
generate_duplex_read_tags(aln);
} else {
generate_read_tags(aln, emit_moves);
generate_read_tags(aln, emit_moves, is_duplex_parent);
}
generate_modbase_tags(aln, modbase_threshold);
alns.push_back(BamPtr(aln));
Expand Down
2 changes: 1 addition & 1 deletion dorado/read_pipeline/ReadPipeline.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class ReadCommon {

private:
void generate_duplex_read_tags(bam1_t*) const;
void generate_read_tags(bam1_t* aln, bool emit_moves, bool is_duplex_parent = false) const;
void generate_read_tags(bam1_t* aln, bool emit_moves, bool is_duplex_parent) const;
void generate_modbase_tags(bam1_t* aln, uint8_t threshold = 0) const;
std::string generate_read_group() const;
};
Expand Down
9 changes: 9 additions & 0 deletions tests/ReadTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,15 @@ TEST_CASE(TEST_GROUP ": Test tag generation", TEST_GROUP) {
read_common.is_duplex = was_duplex;
}

SECTION("Duplex Parent") {
// Update read to be duplex parent
auto alignments = read_common.extract_sam_lines(false, 0, true);
REQUIRE(alignments.size() == 1);
auto* aln = alignments[0].get();

CHECK(bam_aux2i(bam_aux_get(aln, "dx")) == -1);
}

SECTION("No model") {
auto old_model = std::exchange(read_common.model_name, "");

Expand Down

0 comments on commit 7fefd5d

Please sign in to comment.