Skip to content

Commit 910c295

Browse files
Handle all match ops in aligned_blocks (#205)
Handles also `Cigar::Equal` and `Cigar::Diff` in `aligned_blocks`, as suggested by @benwbooth. Closes #199.
1 parent 73c92bf commit 910c295

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/bam/ext.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ impl BamRecordExtensions for bam::Record {
9696
let mut pos = self.pos();
9797
for entry in self.cigar().iter() {
9898
match entry {
99-
Cigar::Match(len) => {
99+
Cigar::Match(len) | Cigar::Equal(len) | Cigar::Diff(len) => {
100100
result.push([pos, pos + *len as i64]);
101101
pos += *len as i64;
102102
}
@@ -113,7 +113,7 @@ impl BamRecordExtensions for bam::Record {
113113
let mut result = Vec::new();
114114
for entry in self.cigar().iter() {
115115
match entry {
116-
Cigar::Match(len) | Cigar::Del(len) | Cigar::Equal(len) | Cigar::Diff(len) => {
116+
Cigar::Match(len) | Cigar::Equal(len) | Cigar::Diff(len) | Cigar::Del(len) => {
117117
base_position += *len as i64
118118
}
119119
Cigar::RefSkip(len) => {

0 commit comments

Comments
 (0)