From 1d171512ec163c296c2f50b9d97aab03f451e9dc Mon Sep 17 00:00:00 2001
From: lestrada <lilia.estrada-virrueta@ens-lyon.fr>
Date: Wed, 6 Jun 2018 14:56:28 +0000
Subject: [PATCH] RNA_Seq.nf: connecting channels in kallisto block

---
 src/RNA_Seq.nf | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/src/RNA_Seq.nf b/src/RNA_Seq.nf
index 0a1baf5..cdfcaa6 100644
--- a/src/RNA_Seq.nf
+++ b/src/RNA_Seq.nf
@@ -109,5 +109,60 @@ bedtools getfasta -name \
 """
 }
 
+/*
+* Kallisto :
+* Imputs : fastq files
+* Imputs : fasta files
+* Output : bam files
+*/
+
+/*                      fasta indexing                                     */
+
+
+process index_fasta {
+  tag "$fasta.baseName"
+  publishDir "results/mapping/index/", mode: 'copy'
+
+  input:
+    file fasta from fasta_file
+
+  output:
+    file "*.index*" into index_files
+
+  script:
+"""
+kallisto index -k 31 --make-unique -i ${fasta.baseName}.index ${fasta} \
+> ${fasta.baseName}_kallisto_report.txt
+"""
+}
+
+
+/*
+* for paired-end data
+*/
+
+process mapping_fastq {
+  tag "$reads"
+  cpus 4
+  publishDir "results/mapping/quantification/", mode: 'copy'
+
+  input:
+  file reads from fastq_files_trim
+  file index from index_files.toList()
+
+  output:
+  file "*" into counts_files
+
+  script:
+"""
+mkdir ${reads[0].baseName}
+kallisto quant -i ${index} -t ${task.cpus} \
+--bias --bootstrap-samples 100 -o ${reads[0].baseName} \
+${reads[0]} ${reads[1]} &> ${reads[0].baseName}_kallisto_report.txt
+"""
+}
+
+
+
 
 
-- 
GitLab