From de028d35c9f5cecc4a0e5539c056fc297556c7e2 Mon Sep 17 00:00:00 2001 From: paul marie <paul.marie@ens-lyon.fr> Date: Fri, 15 Feb 2019 16:32:11 +0100 Subject: [PATCH] src/RNASeq.nf+ .config : ajout de Kallisto --- src/RNASeq.config | 30 ++++++++++++++++++++++++ src/RNASeq.nf | 58 +++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 86 insertions(+), 2 deletions(-) diff --git a/src/RNASeq.config b/src/RNASeq.config index 09fc3bd..c5d6dae 100644 --- a/src/RNASeq.config +++ b/src/RNASeq.config @@ -12,9 +12,18 @@ profiles { withName: fasta_from_bed { container = "bedtools:2.25.0" } + withName: index_fasta { + container = "kallisto:0.44.0" + } + withName: mapping_fastq { + container = "kallisto:0.44.0" + } } } + + + psmn { process{ withName: adaptor_removal { @@ -45,6 +54,27 @@ withName: fasta_from_bed { time = "12h" queue = 'monointeldeb128' } +withName: index_fasta { + beforeScript = "source /usr/share/lmod/lmod/init/bash; module use ~/privatemodules" + module = "Kallisto/0.44.0" + executor = "sge" + clusterOptions = "-m e -cwd -V" + memory = "30GB" + time = "24h" + queue = 'E5-2670deb128A,E5-2670deb128B,E5-2670deb128C,E5-2670deb128D,E5-2670deb128E,E5-2670deb128F' + penv = 'openmp16' + } + withName: mapping_fastq { + beforeScript = "source /usr/share/lmod/lmod/init/bash; module use ~/privatemodules" + module = "Kallisto/0.44.0" + executor = "sge" + clusterOptions = "-m e -cwd -V" + memory = "30GB" + time = "24h" + queue = 'E5-2670deb128A,E5-2670deb128B,E5-2670deb128C,E5-2670deb128D,E5-2670deb128E,E5-2670deb128F' + penv = 'openmp16' + } + } } diff --git a/src/RNASeq.nf b/src/RNASeq.nf index b32bee9..9915b30 100644 --- a/src/RNASeq.nf +++ b/src/RNASeq.nf @@ -2,10 +2,14 @@ params.fastq = "$baseDir/data/fastq/*_{1,2}.fastq" params.fasta = "$baseDir/data/fasta/*.fasta" params.bed = "$baseDir/data/annot/*.bed" + + log.info "fastq files : ${params.fastq}" log.info "fasta file : ${params.fasta}" log.info "bed file : ${params.bed}" + + Channel .fromFilePairs( params.fastq ) .ifEmpty { error "Cannot find any fastq files matching: ${params.fastq}" } @@ -18,6 +22,19 @@ Channel .fromPath( params.bed ) .ifEmpty { error "Cannot find any bed files matching: ${params.bed}" } .set { bed_files } +Channel + .fromPath( params.fasta ) + .ifEmpty { error "Cannot find any bam files matching: ${params.fasta}" } + .set { fasta_file } +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 } + @@ -38,7 +55,6 @@ process adaptor_removal { ${reads[0]} ${reads[1]} > ${pair_id}_report.txt """ } - process trimming { tag "${reads}" cpus 4 @@ -58,7 +74,6 @@ UrQt --t 20 --m ${task.cpus} --gz \ > ${pair_id}_trimming_report.txt """ } - process fasta_from_bed { tag "${bed.baseName}" cpus 4 @@ -77,6 +92,45 @@ bedtools getfasta -name \ -fi ${fasta} -bed ${bed} -fo ${bed.baseName}_extracted.fasta """ } +process index_fasta { + tag "$fasta.baseName" + cpus 4 + publishDir "results/mapping/index/", mode: 'copy' + + input: + file fasta from fasta_files_extracted + + output: + file "*.index*" into index_files + file "*_kallisto_report.txt" into index_files_report + + script: +""" +kallisto index -k 31 --make-unique -i ${fasta.baseName}.index ${fasta} \ +2> ${fasta.baseName}_kallisto_report.txt +""" +} +process mapping_fastq { + tag "$reads" + cpus 4 + publishDir "results/mapping/quantification/", mode: 'copy' + + input: + set pair_id, file(reads) from fastq_files_trim + file index from index_files.collect() + + output: + file "*" into counts_files + + script: +""" +mkdir ${pair_id} +kallisto quant -i ${index} -t ${task.cpus} \ +--bias --bootstrap-samples 100 -o ${pair_id} \ +${reads[0]} ${reads[1]} &> ${pair_id}/kallisto_report.txt +""" +} + -- GitLab