Skip to content

Commit

Permalink
support X and = in mapeval
Browse files Browse the repository at this point in the history
  • Loading branch information
lh3 committed Oct 13, 2024
1 parent 7d69334 commit a4c93e9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions misc/paftools.js
Original file line number Diff line number Diff line change
Expand Up @@ -2187,7 +2187,7 @@ function paf_mapeval(args)
}

var lineno = 0, last = null, a = [], n_unmapped = null;
var re_cigar = /(\d+)([MIDSHN])/g;
var re_cigar = /(\d+)([MIDSHN=X])/g;
while (file.readline(buf) >= 0) {
var m, line = buf.toString();
++lineno;
Expand Down Expand Up @@ -2225,7 +2225,7 @@ function paf_mapeval(args)
var n_gap = 0, mlen = 0;
while ((m = re_cigar.exec(t[5])) != null) {
var len = parseInt(m[1]);
if (m[2] == 'M') pos_end += len, mlen += len;
if (m[2] == 'M' || m[2] == 'X' || m[2] == '=') pos_end += len, mlen += len;
else if (m[2] == 'I') n_gap += len;
else if (m[2] == 'D') n_gap += len, pos_end += len;
}
Expand Down

0 comments on commit a4c93e9

Please sign in to comment.