From 5a367584f8857d65b5ec83a58f30509de56a89e1 Mon Sep 17 00:00:00 2001
From: Laurent Modolo <laurent.modolo@ens-lyon.fr>
Date: Mon, 17 May 2021 17:10:51 +0200
Subject: [PATCH] kb: fix missing \ at end of lines

---
 src/nf_modules/kb/main.nf | 27 +++++++++++++++------------
 1 file changed, 15 insertions(+), 12 deletions(-)

diff --git a/src/nf_modules/kb/main.nf b/src/nf_modules/kb/main.nf
index 32297d25..241c7776 100644
--- a/src/nf_modules/kb/main.nf
+++ b/src/nf_modules/kb/main.nf
@@ -44,7 +44,10 @@ process tr2g {
 
   if (t2g_id == "NO T2G") 
   """
-  t2g.py --gtf ${gtf}
+  t2g.py --gtf ${gtf} && \
+  mv t2g.txt t2g_to_fix.txt && \
+  sed -E 's/\\.[0-9]+//g' t2g_to_fix.txt | \
+    awk '{print(\$1 "\\t" \$2)}' > t2g.txt
   """
   else
   """
@@ -102,12 +105,12 @@ workflow count {
   switch(params.kb_protocol) {
     case "marsseq":
       split(fastq, config)
-      kb_marseq(index.collect(), split.out.fastq, transcript_to_gene, whitelist_optional)
+      kb_marseq(index.collect(), split.out.fastq, transcript_to_gene.collect(), whitelist_optional.collect())
       kb_marseq.out.counts.set{res_counts}
       kb_marseq.out.report.set{res_report}
     break;
     default:
-      kb_default(index, fastq, transcript_to_gene, whitelist_optional)
+      kb_default(index.collect(), fastq, transcript_to_gene.collect(), whitelist_optional.collect())
       kb_default.out.counts.set{res_counts}
       kb_default.out.report.set{res_report}
     break;
@@ -155,11 +158,11 @@ process kb_default {
     -m ${kb_memory} \
     -i ${index} \
     -g ${transcript_to_gene} \
+    -o ${file_prefix} \
     ${whitelist_param} \
-    -x 10XV3
+    -x 10XV3 \
     ${params.count} \
-    -o ${file_prefix} \
-    ${reads[0]} ${reads[1]} &> ${file_prefix}_kb_mapping_report.txt
+    ${reads[0]} ${reads[1]} > ${file_prefix}_kb_mapping_report.txt
   """
 }
 
@@ -204,11 +207,11 @@ process kb_marseq {
     -m ${kb_memory} \
     -i ${index} \
     -g ${transcript_to_gene} \
+    -o ${file_prefix} \
     ${whitelist_param} \
     ${params.count} \
-    -x 1,0,6:1,6,14:1,14,0
-    -o ${file_prefix} \
-    ${reads[0]} ${reads[1]} &> ${file_prefix}_kb_mapping_report.txt
+    -x 1,0,6:1,6,14:1,14,0 \
+    ${reads[0]} ${reads[1]} > ${file_prefix}_kb_mapping_report.txt
   """
   else
   """
@@ -217,10 +220,10 @@ process kb_marseq {
     -m ${kb_memory} \
     -i ${index} \
     -g ${transcript_to_gene} \
+    -o ${file_prefix} \
     ${whitelist_param} \
     ${params.count} \
-    -x 1,0,6:1,6,14:1,14,0
-    -o ${file_prefix} \
-    ${reads} &> ${file_prefix}_kb_mapping_report.txt
+    -x 1,0,6:1,6,14:1,14,0 \
+    ${reads} > ${file_prefix}_kb_mapping_report.txt
   """
 }
\ No newline at end of file
-- 
GitLab