From e4cefc2f870104ac9f3fc0fe2f0bdf6f426af6ce Mon Sep 17 00:00:00 2001
From: Fontrodona Nicolas <nicolas.fontrodona@ens-lyon.fr>
Date: Thu, 20 Sep 2018 17:04:26 +0200
Subject: [PATCH] src/nf_modules/Hisat2/test/mapping_paired.nf : test
 mapping-PE

---
 src/nf_modules/Hisat2/test/mapping_paired.nf | 33 ++++++++++++++++++++
 1 file changed, 33 insertions(+)
 create mode 100644 src/nf_modules/Hisat2/test/mapping_paired.nf

diff --git a/src/nf_modules/Hisat2/test/mapping_paired.nf b/src/nf_modules/Hisat2/test/mapping_paired.nf
new file mode 100644
index 00000000..8350ebc0
--- /dev/null
+++ b/src/nf_modules/Hisat2/test/mapping_paired.nf
@@ -0,0 +1,33 @@
+params.fastq = "$baseDir/data/fastq/*_{1,2}.fastq"
+params.index = "$baseDir/data/index/*.index.*"
+
+log.info "fastq files : ${params.fastq}"
+log.info "index files : ${params.index}"
+
+Channel
+  .fromFilePairs( params.fastq )
+  .ifEmpty { error "Cannot find any fastq files matching: ${params.fastq}" }
+  .set { fastq_files }
+Channel
+  .fromPath( params.index )
+  .ifEmpty { error "Cannot find any index files matching: ${params.index}" }
+  .set { index_files }
+
+process mapping_fastq {
+  tag "$reads"
+  //tag "$index.baseName"
+  cpus 4
+  publishDir "results/mapping/", mode: 'copy'
+
+  input:
+  set pair_id, file(reads) from fastq_files
+  file index from index_files.toList()
+
+  output:
+  file "*" into counts_files
+
+  script:
+"""
+hisat2 -x ${file(file(index[0]).baseName).baseName} -1 ${reads[0]} -2 ${reads[1]} -S ${pair_id}.sam -p ${task.cpus}
+"""
+}
-- 
GitLab