r960: merge changes from the master branch

This commit is contained in:
Heng Li 2014-10-28 13:46:40 -04:00
parent 0f8a164bd3
commit 6db2fd98aa
3 changed files with 11 additions and 9 deletions

View File

@ -577,11 +577,12 @@ function bwa_postalt(args)
// stage the hits generated from the XA tag
var cnt = 0;
var rg = (m = /\t(RG:Z:\S+)/.exec(line)) != null? m[1] : null;
for (var i = 0; i < hits.length; ++i) {
if (opt.verbose >= 5) print(obj2str(hits[i]));
if (hits[i].g != reported_g || i == reported_i) continue;
if (!opt.show_pri && idx_alt[hits[i].ctg] == null) continue;
var s = [t[0], 0, hits[i].ctg, hits[i].start+1, mapQ, hits[i].cigar, '*', 0, 0];
var s = [t[0], 0, hits[i].ctg, hits[i].start+1, mapQ, hits[i].cigar, t[6], t[7], t[8]];
// print sequence/quality and set the rev flag
if (hits[i].rev == hits[reported_i].rev) {
s.push(t[9], t[10]);
@ -592,6 +593,7 @@ function bwa_postalt(args)
}
s.push("NM:i:" + hits[i].NM);
if (hits[i].lifted_str) s.push("lt:Z:" + hits[i].lifted_str);
if (rg != null) s.push(rg);
buf2.push(s);
}
}

View File

@ -327,13 +327,13 @@ int mem_sam_pe(const mem_opt_t *opt, const bntseq_t *bns, const uint8_t *pac, co
// suboptimal hits
if (!(opt->flag & MEM_F_ALL)) {
for (i = 0; i < 2; ++i) {
int k = a[i].a[z[i]].secondary;
if (k >= 0) { // switch secondary and primary
assert(a[i].a[k].secondary < 0);
for (j = 0; j < n_pri[i]; ++j)
if (a[i].a[j].secondary == k || j == k)
a[i].a[j].secondary = z[i];
a[i].a[z[i]].secondary = -1;
int k = a[i].a[z[i]].secondary_all;
if (k >= 0 && k < n_pri[i]) { // switch secondary and primary if both of them are non-ALT
assert(a[i].a[k].secondary_all < 0);
for (j = 0; j < a[i].n; ++j)
if (a[i].a[j].secondary_all == k || j == k)
a[i].a[j].secondary_all = z[i];
a[i].a[z[i]].secondary_all = -1;
}
XA[i] = mem_gen_alt(opt, bns, pac, &a[i], s[i].l_seq, s[i].seq);
}

2
main.c
View File

@ -4,7 +4,7 @@
#include "utils.h"
#ifndef PACKAGE_VERSION
#define PACKAGE_VERSION "0.7.10-r943-dirty"
#define PACKAGE_VERSION "0.7.10-r960-dirty"
#endif
int bwa_fa2pac(int argc, char *argv[]);