diff --git a/src/nf_modules/Kallisto/kallisto.nf b/src/nf_modules/Kallisto/kallisto.nf index cd7b1ea43bc30af102f08283201f33e6bf3a759a..ae6b6b71a524d49bf4f9c1ff9db8517c4c80de01 100644 --- a/src/nf_modules/Kallisto/kallisto.nf +++ b/src/nf_modules/Kallisto/kallisto.nf @@ -91,6 +91,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 ) @@ -98,12 +99,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: @@ -111,11 +112,12 @@ process mapping_fastq { script: """ -mkdir ${reads.baseName} -kallisto quant -i ${index} -t ${task.cpus} --single ---bias --bootstrap-samples 100 -o ${reads.baseName} \ --l ${params.mean} -s ${params.sd} -o ./ \ -${reads} > ${reads.baseName}_kallisto_report.txt +mkdir ${file_id} +kallisto quant -i ${index} -t ${task.cpus} --single \ +--bias --bootstrap-samples 100 -o ${file_id} \ +-l ${params.mean} -s ${params.sd} \ +${reads} > ${file_id}_kallisto_report.txt """ } + diff --git a/src/nf_modules/Kallisto/tests/mapping_single.nf b/src/nf_modules/Kallisto/tests/mapping_single.nf index 69e3a6fdcafe5d1804a96cd482f6b5ff4cf50bfe..cba5aff21d88cc43c142e6f075f8740d8a0506f8 100644 --- a/src/nf_modules/Kallisto/tests/mapping_single.nf +++ b/src/nf_modules/Kallisto/tests/mapping_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: @@ -31,11 +32,11 @@ process mapping_fastq { script: """ -mkdir ${reads.baseName} +mkdir ${file_id} kallisto quant -i ${index} -t ${task.cpus} --single \ ---bias --bootstrap-samples 100 -o ${reads.baseName} \ +--bias --bootstrap-samples 100 -o ${file_id} \ -l ${params.mean} -s ${params.sd} \ -${reads} > ${reads.baseName}_kallisto_report.txt +${reads} > ${file_id}_kallisto_report.txt """ }