mirror of
https://github.com/lh3/minimap2.git
synced 2026-10-06 18:58:12 +08:00
changed the way mapq is counted
This commit is contained in:
+4
-7
@@ -72,20 +72,17 @@ function count_err(qname, a, tot, err, mode)
|
|||||||
s[2] = parseInt(s[2]);
|
s[2] = parseInt(s[2]);
|
||||||
s[3] = parseInt(s[3]);
|
s[3] = parseInt(s[3]);
|
||||||
s.shift(); // skip pbsim orginal read name
|
s.shift(); // skip pbsim orginal read name
|
||||||
var max_mapq = 0;
|
|
||||||
for (var i = 0; i < a.length; ++i)
|
|
||||||
if (a[i][4] > max_mapq)
|
|
||||||
max_mapq = a[i][4];
|
|
||||||
++tot[max_mapq];
|
|
||||||
if (mode == 0) { // longest only
|
if (mode == 0) { // longest only
|
||||||
var max = 0, max_i = -1;
|
var max = 0, max_i = -1;
|
||||||
for (var i = 0; i < a.length; ++i)
|
for (var i = 0; i < a.length; ++i)
|
||||||
if (a[i][2] - a[i][1] > max)
|
if (a[i][2] - a[i][1] > max)
|
||||||
max = a[i][2] - a[i][1], max_i = i;
|
max = a[i][2] - a[i][1], max_i = i;
|
||||||
|
var mapq = a[max_i][4];
|
||||||
|
++tot[mapq];
|
||||||
if (!is_correct(s, a[max_i])) {
|
if (!is_correct(s, a[max_i])) {
|
||||||
if (max_mapq >= err_out_q)
|
if (mapq >= err_out_q)
|
||||||
print('E', qname, a[max_i].join("\t"));
|
print('E', qname, a[max_i].join("\t"));
|
||||||
++err[max_mapq];
|
++err[mapq];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user