r921: output unmapped reads in full PAF
This commit is contained in:
parent
90b7b83ec7
commit
55e39c2d30
2
format.c
2
format.c
|
|
@ -305,7 +305,7 @@ void mm_write_paf3(kstring_t *s, const mm_idx_t *mi, const mm_bseq1_t *t, const
|
||||||
{
|
{
|
||||||
s->l = 0;
|
s->l = 0;
|
||||||
if (r == 0) {
|
if (r == 0) {
|
||||||
mm_sprintf_lite(s, "%s\t%d", t->name, t->l_seq);
|
mm_sprintf_lite(s, "%s\t%d\t0\t0\t*\t*\t0\t0\t0\t0\t0\t0", t->name, t->l_seq);
|
||||||
if (rep_len >= 0) mm_sprintf_lite(s, "\trl:i:%d", rep_len);
|
if (rep_len >= 0) mm_sprintf_lite(s, "\trl:i:%d", rep_len);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
2
main.c
2
main.c
|
|
@ -6,7 +6,7 @@
|
||||||
#include "mmpriv.h"
|
#include "mmpriv.h"
|
||||||
#include "ketopt.h"
|
#include "ketopt.h"
|
||||||
|
|
||||||
#define MM_VERSION "2.15-r917-dirty"
|
#define MM_VERSION "2.15-r921-dirty"
|
||||||
|
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
#include <sys/resource.h>
|
#include <sys/resource.h>
|
||||||
|
|
|
||||||
|
|
@ -474,7 +474,9 @@ Filter out query sequences longer than
|
||||||
.IR NUM .
|
.IR NUM .
|
||||||
.TP
|
.TP
|
||||||
.B --paf-no-hit
|
.B --paf-no-hit
|
||||||
In PAF, output query name and length for an unmapped sequence.
|
In PAF, output unmapped queries; the strand and the reference name fields are
|
||||||
|
set to `*'. Warning: some paftools.js commands may not work with such output
|
||||||
|
for the moment.
|
||||||
.TP
|
.TP
|
||||||
.B --version
|
.B --version
|
||||||
Print version number to stdout
|
Print version number to stdout
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env k8
|
#!/usr/bin/env k8
|
||||||
|
|
||||||
var paftools_version = '2.15-r916-dirty';
|
var paftools_version = '2.15-r921-dirty';
|
||||||
|
|
||||||
/*****************************
|
/*****************************
|
||||||
***** Library functions *****
|
***** Library functions *****
|
||||||
|
|
@ -433,6 +433,7 @@ function paf_call(args)
|
||||||
while (file.readline(buf) >= 0) {
|
while (file.readline(buf) >= 0) {
|
||||||
var line = buf.toString();
|
var line = buf.toString();
|
||||||
var m, t = line.split("\t", 12);
|
var m, t = line.split("\t", 12);
|
||||||
|
if (t.length < 12 || t[5] == '*') continue; // unmapped
|
||||||
for (var i = 6; i <= 11; ++i)
|
for (var i = 6; i <= 11; ++i)
|
||||||
t[i] = parseInt(t[i]);
|
t[i] = parseInt(t[i]);
|
||||||
if (t[10] < min_cov_len || t[11] < min_mapq) continue;
|
if (t[10] < min_cov_len || t[11] < min_mapq) continue;
|
||||||
|
|
@ -680,13 +681,12 @@ function paf_asmstat(args)
|
||||||
var t = line.split("\t");
|
var t = line.split("\t");
|
||||||
t[1] = parseInt(t[1]);
|
t[1] = parseInt(t[1]);
|
||||||
if (t[1] < min_query_len) continue;
|
if (t[1] < min_query_len) continue;
|
||||||
if (t.length >= 2) {
|
if (t.length < 2) continue;
|
||||||
query[t[0]] = t[1];
|
query[t[0]] = t[1];
|
||||||
if (qinfo[t[0]] == null) qinfo[t[0]] = {};
|
if (qinfo[t[0]] == null) qinfo[t[0]] = {};
|
||||||
qinfo[t[0]].len = t[1];
|
qinfo[t[0]].len = t[1];
|
||||||
qinfo[t[0]].bp = [];
|
qinfo[t[0]].bp = [];
|
||||||
}
|
if (t.length < 9 || t[5] == "*") continue;
|
||||||
if (t.length < 9) continue;
|
|
||||||
if (!/\ttp:A:[PI]/.test(line)) continue;
|
if (!/\ttp:A:[PI]/.test(line)) continue;
|
||||||
if ((m = /\tcg:Z:(\S+)/.exec(line)) == null) continue;
|
if ((m = /\tcg:Z:(\S+)/.exec(line)) == null) continue;
|
||||||
var cigar = m[1];
|
var cigar = m[1];
|
||||||
|
|
@ -967,7 +967,9 @@ function paf_stat(args)
|
||||||
var t = line.split("\t", 12);
|
var t = line.split("\t", 12);
|
||||||
var m, rs, cigar = null, is_pri = false, is_sam = false, is_rev = false, tname = null;
|
var m, rs, cigar = null, is_pri = false, is_sam = false, is_rev = false, tname = null;
|
||||||
var atlen = null, aqlen, qs, qe, mapq, ori_qlen;
|
var atlen = null, aqlen, qs, qe, mapq, ori_qlen;
|
||||||
if (t[4] == '+' || t[4] == '-') { // PAF
|
if (t.length < 2) continue;
|
||||||
|
if (t[4] == '+' || t[4] == '-' || t[4] == '*') { // PAF
|
||||||
|
if (t[4] == '*') continue; // unmapped
|
||||||
if (!/\ts2:i:\d+/.test(line)) {
|
if (!/\ts2:i:\d+/.test(line)) {
|
||||||
++n_2nd;
|
++n_2nd;
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue