From 0ee2e222dc72876a953badf1152d537b4b57aef5 Mon Sep 17 00:00:00 2001
From: aliarifki <aliarifki@outlook.fr>
Date: Thu, 22 Jun 2023 10:03:53 +0200
Subject: [PATCH] Correction des erreurs du process barcoding

---
 src/nf_modules/ont-guppy/main.nf | 43 ++++++++++++++++++++++++++------
 1 file changed, 36 insertions(+), 7 deletions(-)

diff --git a/src/nf_modules/ont-guppy/main.nf b/src/nf_modules/ont-guppy/main.nf
index c4f8278..f9f6aed 100644
--- a/src/nf_modules/ont-guppy/main.nf
+++ b/src/nf_modules/ont-guppy/main.nf
@@ -12,7 +12,7 @@ params.chunks_per_runner = 1
 options = ""
 process basecall_fast5_gpu {
   container = "${container_url}"
-  label "gpu"
+  label "gpus"
   tag "$fast5_folder"
   if (params.basecalling_out != "") {
     publishDir "results/${params.basecalling_out}", mode: 'copy'
@@ -64,6 +64,7 @@ guppy_basecaller --compress_fastq \
 """
 }
 
+// A modifier quand le process gpu marchera
 process basecall_fast5_cpu {
   container = "${container_url}"
   label "big_mem_multi_cpus"
@@ -106,7 +107,36 @@ guppy_basecaller --compress_fastq \
 """
 }
 
-process barcoding {
+params.kit_barcoding = "EXP-PBC001"
+process barcoding_gpu {
+  container = "${container_url}"
+  label "gpus"
+  tag "$fast5_folder"
+  if (params.barcoding_out != "") {
+    publishDir "results/${params.barcoding_out}", mode: 'copy'
+  }
+
+  input:
+    path(pass_path)
+  
+  output:
+    path("*")
+  
+  script:
+"""
+guppy_barcoder \
+  --input_path ${pass_path} \
+  --save_path . \
+  -t ${params.gpu_threads_per_caller} \
+  --barcode_kits ${params.kit_barcoding} \
+  --progress_stats_frequency 60 \
+  --enable_trim_barcodes \
+  --trim_adapters \
+  --compress_fastq
+"""
+}
+
+process barcoding_cpu {
   container = "${container_url}"
   label "big_mem_multi_cpus"
   tag "$fast5_folder"
@@ -118,17 +148,16 @@ process barcoding {
     path(pass_path)
   
   output:
-    path("barcode")
+    path("*")
   
   script:
 """
 guppy_barcoder \
   --input_path ${pass_path} \
-  --save_path barcode/ \
-  -c /opt/ont/guppy/data/${params.config_file} \
-  --barcode_kits ${params.kit} \
+  --save_path . \
+  -t ${task.cpus} \
+  --barcode_kits ${params.kit_barcoding} \
   --progress_stats_frequency 60 \
-  -x "cuda:all" \
   --enable_trim_barcodes \
   --trim_adapters \
   --compress_fastq
-- 
GitLab