From de85b1dd007917a74232e7cf61c6a7d5b8346cdf Mon Sep 17 00:00:00 2001
From: hpolvech <helene.polveche@ens-lyon.fr>
Date: Wed, 6 Jun 2018 14:54:30 +0000
Subject: [PATCH] RNAseq.nf: Kallisto

---
 src/RNASeq.nf | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 59 insertions(+)

diff --git a/src/RNASeq.nf b/src/RNASeq.nf
index eb6d3a6..8a1e968 100644
--- a/src/RNASeq.nf
+++ b/src/RNASeq.nf
@@ -93,6 +93,65 @@ bedtools getfasta -name \
 }
 
 
+/*
+* Kallisto :
+* Imputs : fastq files
+* Imputs : fasta files
+* Output : bam files
+*/
+
+/*                      fasta indexing                                     */
+
+
+/*Channel
+* .fromPath( params.fasta )
+* .ifEmpty { error "Cannot find any fasta files matching: ${params.fasta}" }
+*  .set { fasta_file }
+*/
+
+process index_fasta {
+  tag "$fasta.baseName"
+  publishDir "results/mapping/index/", mode: 'copy'
+
+  input:
+    file fasta from fasta_files_extracted
+
+  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