Skip to content

Commit

Permalink
fix: NM tag properly calculated for chains (#61)
Browse files Browse the repository at this point in the history
* fix: NM tag properly calculated for chains

Reset num_endits in align::sub_alignment

Fixes #60
  • Loading branch information
nh13 authored Sep 20, 2023
1 parent e4bf56f commit 5942203
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fg-stitch-lib/src/align/sub_alignment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ impl SubAlignmentBuilder {
self.target_start = self.target_offset;
self.query_start = self.query_offset;
self.score = 0;
self.num_edits = 0;

Some(alignment)
}
Expand Down Expand Up @@ -177,6 +178,7 @@ impl SubAlignmentBuilder {
self.query_offset = self.query_start;
self.target_offset = self.target_start;
self.score = 0;
self.num_edits = 0;
self.contig_idx = chain.start_contig_idx;

let mut alignments = Vec::new();
Expand Down Expand Up @@ -229,7 +231,7 @@ impl SubAlignmentBuilder {
target_end: a.query_end,
cigar: Self::swap_cigar(&a.cigar),
score: a.score,
num_edits: self.num_edits,
num_edits: a.num_edits,
contig_idx: a.contig_idx,
})
.collect_vec()
Expand Down

0 comments on commit 5942203

Please sign in to comment.