From 329e23003829425a31bb53e0545bcf5199088621 Mon Sep 17 00:00:00 2001
From: Laurent Modolo <laurent.modolo@ens-lyon.fr>
Date: Thu, 29 Apr 2021 14:38:53 +0200
Subject: [PATCH] flexi_splitter: try to fix bug

---
 src/nf_modules/flexi_splitter/main.nf | 4 ++--
 src/nf_modules/kb/main.nf             | 7 ++++---
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/nf_modules/flexi_splitter/main.nf b/src/nf_modules/flexi_splitter/main.nf
index 6e01c268..d7a87b94 100644
--- a/src/nf_modules/flexi_splitter/main.nf
+++ b/src/nf_modules/flexi_splitter/main.nf
@@ -30,10 +30,10 @@ process split {
 
   if (reads.size() == 2)
   """
-  flexi_splitter ${params.split} -f ${reads[0]} ${reads[1]} -c ${config} -o split
+  flexi_splitter ${params.split} -n 2 -f ${reads[0]} ${reads[1]} -o split -c ${config}
   """
   else
   """
-  flexi_splitter ${params.split} -f ${reads[0]} -c ${config} -o split
+  flexi_splitter ${params.split} -n 1 -f ${reads[0]} -o split -c ${config}
   """
 }
diff --git a/src/nf_modules/kb/main.nf b/src/nf_modules/kb/main.nf
index fe08a0df..0dcc470d 100644
--- a/src/nf_modules/kb/main.nf
+++ b/src/nf_modules/kb/main.nf
@@ -137,6 +137,7 @@ process kb_default {
   tuple val(file_id), path("*_report.txt"), emit: report
 
   script:
+  def kb_memory = "${task.memory}" - ~/GB/
   if (file_id instanceof List){
     file_prefix = file_id[0]
   } else {
@@ -151,7 +152,7 @@ process kb_default {
   """
   mkdir ${file_prefix}
   kb count  -t ${task.cpus} \
-    -m ${task.memory} \
+    -m ${kb_memory} \
     -i ${index} \
     -g ${transcript_to_gene} \
     ${whitelist_param} \
@@ -185,7 +186,7 @@ process kb_marseq {
   tuple val(file_id), path("*_report.txt"), emit: report
 
   script:
-  memory = "${task.memory}" - ~/\s*GB/
+  def kb_memory = "${task.memory}" - ~/GB/
   if (file_id instanceof List){
     file_prefix = file_id[0]
   } else {
@@ -200,7 +201,7 @@ process kb_marseq {
   """
   mkdir ${file_prefix}
   kb count  -t ${task.cpus} \
-    -m ${memory} \
+    -m ${kb_memory} \
     -i ${index} \
     -g ${transcript_to_gene} \
     ${whitelist_param} \
-- 
GitLab