From dd17f66aeb004b38acd96cb136379fe0a131207d Mon Sep 17 00:00:00 2001
From: elabaron <emmanuel.labaronne@ens-lyon.fr>
Date: Wed, 6 Jun 2018 14:01:03 +0000
Subject: [PATCH] RNAseq.nf : create adaptor_removal block

---
 src/RNAseq.nf | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
 create mode 100644 src/RNAseq.nf

diff --git a/src/RNAseq.nf b/src/RNAseq.nf
new file mode 100644
index 0000000..2e8d1a9
--- /dev/null
+++ b/src/RNAseq.nf
@@ -0,0 +1,27 @@
+params.fastq = "$baseDir/data/fastq/*_{1,2}.fastq" /* we can use now a param -fastq to specify where are fastq files. this path is the default path */
+
+log.info "fastq files : ${params.fastq}"
+
+Channel
+  .fromFilePairs( params.fastq )
+  .ifEmpty { error "Cannot find any fastq files matching: ${params.fastq}" }
+  .set { fastq_files }
+
+process adaptor_removal {
+  tag "$pair_id"
+  publishDir "results/fastq/adaptor_removal/", mode: 'copy'
+
+  input:
+  set pair_id, file(reads) from fastq_files
+
+  output:
+  file "*_cut_R{1,2}.fastq.gz" into fastq_files_cut
+
+  script:
+  """
+  cutadapt -a AGATCGGAAGAG -g CTCTTCCGATCT -A AGATCGGAAGAG -G CTCTTCCGATCT \
+  -o ${pair_id}_cut_R1.fastq.gz -p ${pair_id}_cut_R2.fastq.gz \
+  ${reads[0]} ${reads[1]} > ${pair_id}_report.txt
+  """
+}
+
-- 
GitLab