From 947dc8333bfeaad5f27bca1939fa7b3092fbc1b3 Mon Sep 17 00:00:00 2001
From: Venkat Malladi <venkat.malladi@utsouthwestern.edu>
Date: Wed, 27 Jun 2018 11:11:31 -0500
Subject: [PATCH] Fix tn5 shift.

---
 workflow/scripts/convert_reads.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/workflow/scripts/convert_reads.py b/workflow/scripts/convert_reads.py
index 5e856d5..846fad0 100644
--- a/workflow/scripts/convert_reads.py
+++ b/workflow/scripts/convert_reads.py
@@ -130,7 +130,7 @@ def tn5_shift_tagalign(tag_filename, shitfted_tag_filename):
 
     steps = [
         "zcat -f %s" % (tag_filename),
-        r"""awk 'BEGIN{OFS="\t"}{{if ($6 == "+") {{$2 = $2 + 4}}; else if ($6 == "-") {{$3 = $3 - 5}} print $0}}'""",
+        r"""awk 'BEGIN {OFS = FS}{ if ($6 == "+") {$2 = $2 + 4} else if ($6 == "-") {$3 = $3 - 5} print $0}'""",
         "gzip -nc"]
     out, err = utils.run_pipe(steps, outfile=shitfted_tag_filename)
 
-- 
GitLab