From b0c2f875f7b0723cbe43341ccf6757b9f2a51d7e Mon Sep 17 00:00:00 2001 From: Ben Sherman Date: Tue, 29 Oct 2024 10:43:25 +0100 Subject: [PATCH] Refactor output directory structure Signed-off-by: Ben Sherman --- bin/fastqc.sh | 7 +++---- main.nf | 2 +- modules/fastqc/main.nf | 4 ++-- modules/quant/main.nf | 4 ++-- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/bin/fastqc.sh b/bin/fastqc.sh index 93f38b6..8138193 100755 --- a/bin/fastqc.sh +++ b/bin/fastqc.sh @@ -1,6 +1,5 @@ #!/usr/bin/env bash -sample_id="$1" -reads="$2" +reads="$1" -mkdir fastqc_${sample_id}_logs -fastqc -o fastqc_${sample_id}_logs -f fastq -q ${reads} +mkdir fastqc +fastqc -o fastqc -f fastq -q ${reads} diff --git a/main.nf b/main.nf index 8ce4333..ba2bca2 100755 --- a/main.nf +++ b/main.nf @@ -73,7 +73,7 @@ workflow { output { samples { - path '.' + path { id, _quant, _fastqc -> "${workflow.outputDir}/${id}" } index { path 'index.json' mapper { id, quant, fastqc -> diff --git a/modules/fastqc/main.nf b/modules/fastqc/main.nf index cb960be..abd06f7 100644 --- a/modules/fastqc/main.nf +++ b/modules/fastqc/main.nf @@ -7,10 +7,10 @@ process FASTQC { tuple val(sample_id), path(fastq_1), path(fastq_2) output: - tuple val(sample_id), path("fastqc_${sample_id}_logs"), emit: logs + tuple val(sample_id), path('fastqc') script: """ - fastqc.sh "$sample_id" "$fastq_1 $fastq_2" + fastqc.sh "$fastq_1 $fastq_2" """ } diff --git a/modules/quant/main.nf b/modules/quant/main.nf index 027f9d5..a53fedf 100644 --- a/modules/quant/main.nf +++ b/modules/quant/main.nf @@ -8,10 +8,10 @@ process QUANT { tuple val(sample_id), path(fastq_1), path(fastq_2) output: - tuple val(sample_id), path(sample_id) + tuple val(sample_id), path('quant') script: """ - salmon quant --threads $task.cpus --libType=U -i $index -1 ${fastq_1} -2 ${fastq_2} -o $sample_id + salmon quant --threads $task.cpus --libType=U -i $index -1 ${fastq_1} -2 ${fastq_2} -o quant """ }