Skip to content

Commit

Permalink
Small bugfix for paftools.js
Browse files Browse the repository at this point in the history
The bug resulted in the wrong coverage being printed in some cases.
  • Loading branch information
apregier authored and lh3 committed Apr 4, 2018
1 parent ee4cd08 commit 2e2e691
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 @@ -484,7 +484,7 @@ function paf_call(args)
// drop alignments that don't overlap with the current one
var k = 0;
for (var i = 0; i < a.length; ++i)
if (a[0][0] == ctg && a[0][2] > x)
if (a[i][0] == ctg && a[i][2] > x)
a[k++] = a[i];
a.length = k;
// core loop
Expand All @@ -496,7 +496,7 @@ function paf_call(args)
var cov = 1;
if (m[1] == '*' || m[1] == '+' || m[1] == '-')
for (var i = 0; i < a.length; ++i)
if (a[0][2] > x) ++cov;
if (a[i][2] > x) ++cov;
var qs, qe;
if (m[1] == '=' || m[1] == ':') {
var l = m[1] == '='? m[2].length : parseInt(m[2]);
Expand Down

0 comments on commit 2e2e691

Please sign in to comment.