From 2e2e69107cf1a0a3e3ed9bd1c61bce50e976c3c7 Mon Sep 17 00:00:00 2001 From: apregier Date: Wed, 4 Apr 2018 14:19:16 -0500 Subject: [PATCH] Small bugfix for paftools.js The bug resulted in the wrong coverage being printed in some cases. --- misc/paftools.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/misc/paftools.js b/misc/paftools.js index cb5ebdd7..9fdebcf7 100755 --- a/misc/paftools.js +++ b/misc/paftools.js @@ -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 @@ -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]);