From 7ed402cc70cb45812006bd7d8476bdf8a7db1469 Mon Sep 17 00:00:00 2001 From: Laurent Modolo <laurent.modolo@ens-lyon.fr> Date: Thu, 2 Aug 2018 17:06:00 +0200 Subject: [PATCH] RSEM: nf add file_id var in single-end like for paired-end --- src/nf_modules/RSEM/rsem.nf | 11 ++++++----- src/nf_modules/RSEM/tests/quantification_single.nf | 7 ++++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/nf_modules/RSEM/rsem.nf b/src/nf_modules/RSEM/rsem.nf index 9a14cc8..aa2fc95 100644 --- a/src/nf_modules/RSEM/rsem.nf +++ b/src/nf_modules/RSEM/rsem.nf @@ -96,7 +96,7 @@ rsem-calculate-expression --bowtie2 \ params.fastq = "$baseDir/data/fastq/*.fastq" params.index = "$baseDir/data/index/*.index*" -params.mean = 300 +params.mean = 125 params.sd = 100 log.info "fastq files : ${params.fastq}" @@ -107,6 +107,7 @@ log.info "sd read size: ${params.sd}" Channel .fromPath( params.fastq ) .ifEmpty { error "Cannot find any fastq files matching: ${params.fastq}" } + .map { it -> [(it.baseName =~ /([^\.]*)/)[0][1], it]} .set { fastq_files } Channel .fromPath( params.index ) @@ -114,12 +115,12 @@ Channel .set { index_files } process mapping_fastq { - tag "$reads.baseName" + tag "$file_id" cpus 4 publishDir "results/mapping/quantification/", mode: 'copy' input: - file reads from fastq_files + set file_id, file(reads) from fastq_files file index from index_files.collect() output: @@ -133,7 +134,7 @@ rsem-calculate-expression --bowtie2 \ --bowtie2-sensitivity-level "very_sensitive" \ --fragment-length-mean ${params.mean} --fragment-length-sd ${params.sd} \ --output-genome-bam -p ${task.cpus} \ -${reads} ${index_name} ${tagname} > ${tagname}_rsem_bowtie2_report.txt +${reads} ${index_name} ${file_id} \ +> ${reads.baseName}_rsem_bowtie2_report.txt """ } - diff --git a/src/nf_modules/RSEM/tests/quantification_single.nf b/src/nf_modules/RSEM/tests/quantification_single.nf index 63b2a40..47e0047 100644 --- a/src/nf_modules/RSEM/tests/quantification_single.nf +++ b/src/nf_modules/RSEM/tests/quantification_single.nf @@ -11,6 +11,7 @@ log.info "sd read size: ${params.sd}" Channel .fromPath( params.fastq ) .ifEmpty { error "Cannot find any fastq files matching: ${params.fastq}" } + .map { it -> [(it.baseName =~ /([^\.]*)/)[0][1], it]} .set { fastq_files } Channel .fromPath( params.index ) @@ -18,12 +19,12 @@ Channel .set { index_files } process mapping_fastq { - tag "$reads.baseName" + tag "$file_id" cpus 4 publishDir "results/mapping/quantification/", mode: 'copy' input: - file reads from fastq_files + set file_id, file(reads) from fastq_files file index from index_files.collect() output: @@ -37,7 +38,7 @@ rsem-calculate-expression --bowtie2 \ --bowtie2-sensitivity-level "very_sensitive" \ --fragment-length-mean ${params.mean} --fragment-length-sd ${params.sd} \ --output-genome-bam -p ${task.cpus} \ -${reads} ${index_name} ${reads.baseName} \ +${reads} ${index_name} ${file_id} \ > ${reads.baseName}_rsem_bowtie2_report.txt """ } -- GitLab