From f2dca0931db5b0046d0407a0bda4618ffbc987be Mon Sep 17 00:00:00 2001
From: aliarifki <aliarifki@outlook.fr>
Date: Thu, 1 Jun 2023 16:42:16 +0200
Subject: [PATCH] =?UTF-8?q?Ajout=20de=20l'outil=20ps=20au=20dockerfile=20r?=
 =?UTF-8?q?-bolero=20et=20r=C3=A9solution=20d'erreurs=20dans=20la=20foncti?=
 =?UTF-8?q?on=20concatenate=20de=20seqkit?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/.docker_modules/r-bolero/1.0/Dockerfile |  7 ++++++-
 src/bolero.nf                               | 17 ++++++++---------
 src/nf_modules/seqkit/main.nf               |  5 +++--
 3 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/src/.docker_modules/r-bolero/1.0/Dockerfile b/src/.docker_modules/r-bolero/1.0/Dockerfile
index 3407ad5..de41dda 100644
--- a/src/.docker_modules/r-bolero/1.0/Dockerfile
+++ b/src/.docker_modules/r-bolero/1.0/Dockerfile
@@ -3,9 +3,14 @@ LABEL AUTHOR="Alia Rifki"
 LABEL MAINTAINER="Xavier Grand <xavier.grand@inserm.fr>"
 LABEL build_date="2023-05-26"
 
-## copy Rscript files
+## Copy all Rscript files
 COPY ./*.R .
 
+## Install packages
 RUN Rscript Install_packages.R
 
+RUN apt-get update && apt-get install -y procps
+
+## Langage
 CMD ["bash"]
+
diff --git a/src/bolero.nf b/src/bolero.nf
index 41e7bda..3ff3c53 100755
--- a/src/bolero.nf
+++ b/src/bolero.nf
@@ -53,7 +53,7 @@ def helpMessage() {
       --chunk_size [int]              Chunck size, default = 1900 (refer to guppy manual).
 
     Help:
-      --help                          Display this help message.
+      --help | --h                   Display this help message.
     
     """.stripIndent()
 }
@@ -111,7 +111,6 @@ params.pycoQC_out = "pycoQC/"
  ****************************************************************
 */
 
-//to print multiline informations
 log.info "fast5/q folder : ${params.input}"
 log.info "5'RACE adapter sequence : ${params.adapt}"
 if(!params.skipBC) log.info "Guppy basecalling calculation using GPU mode : ${params.gpu_mode}."
@@ -163,8 +162,9 @@ if(!params.skipBC) {
 }
 
 // Replace concatenate by seqkit fct to parallelization:
-// include { concatenate } from "./nf_modules/seqkit/main.nf"
-include { concatenate } from "./nf_modules/concatenate/main.nf"
+include { concatenate } from "./nf_modules/seqkit/main.nf"
+//include { concatenate } from "./nf_modules/concatenate/main.nf"
+
 include { cut_5pRACE } from "./nf_modules/cutadapt/main.nf"
 include { hbv_genome } from "./nf_modules/minimap2/main.nf"
 include { seqkit_grep } from "./nf_modules/seqkit/main.nf"
@@ -177,9 +177,6 @@ include { jwr_checker } from "./nf_modules/nanosplicer/main.nf"
 include { junctions_nanosplicer } from "./nf_modules/junction_nanosplicer/main.nf"
 include { rna_count } from "./nf_modules/rna_count/main.nf"
 
-/////////////////////////////////////////////////////////
-// script R avec classification des reads par type d'ARN et graphiques associés
-
 
 // creation des fonctions NanoSplicer:
 // include { jwr_check } from "./nf_modules/nanosplicer/main.nf"
@@ -211,7 +208,7 @@ workflow {
     }
   }
   //####################### PREPROCESSING #######################
-
+  
   
   
   //Filtration (seqkit_grep looks for the 5'RACE and the gsp patterns in the reads to keep only mature ARNs)
@@ -220,8 +217,10 @@ workflow {
   //Cut of the 5'RACE sequence
   cut_5pRACE(seqkit_grep.out.filtered_fastq, params.adapt)
 
-  //########################## MAPPING ##########################
   
+
+  //########################## MAPPING ##########################
+
   
   hbv_genome(cut_5pRACE.out.fastq_cutadapt, genome)
   sort_index_bam(hbv_genome.out.bam)
diff --git a/src/nf_modules/seqkit/main.nf b/src/nf_modules/seqkit/main.nf
index 3f2cb3b..e6d7e6b 100755
--- a/src/nf_modules/seqkit/main.nf
+++ b/src/nf_modules/seqkit/main.nf
@@ -71,14 +71,15 @@ process concatenate {
   }
 
   input:
-    path(fastq_dir)
+    path fastq
 
   output:
     path "merged.fastq.gz", emit: merged_fastq
 
   script:
     """
-    seqkit scat -j ${tasks.cpus} -f ${fastq_dir} --gz-only > merged.fastq
+    path=\$(readlink -f ${fastq})
+    seqkit scat -j ${task.cpus} -f \${path} --gz-only > merged.fastq
     gzip merged.fastq
     """
 }
\ No newline at end of file
-- 
GitLab