From 5c87869d91ccd686faf829d82bcbe6a2d3939591 Mon Sep 17 00:00:00 2001 From: Heng Li Date: Mon, 27 Oct 2014 10:45:07 -0400 Subject: [PATCH] keep RG --- bwa-postalt.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bwa-postalt.js b/bwa-postalt.js index b538552..9abc674 100644 --- a/bwa-postalt.js +++ b/bwa-postalt.js @@ -577,6 +577,7 @@ 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; @@ -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); } }