Skip to content

Commit b0c2f87

Browse files
committed
Refactor output directory structure
Signed-off-by: Ben Sherman <[email protected]>
1 parent 642dbad commit b0c2f87

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

bin/fastqc.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/usr/bin/env bash
2-
sample_id="$1"
3-
reads="$2"
2+
reads="$1"
43

5-
mkdir fastqc_${sample_id}_logs
6-
fastqc -o fastqc_${sample_id}_logs -f fastq -q ${reads}
4+
mkdir fastqc
5+
fastqc -o fastqc -f fastq -q ${reads}

main.nf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ workflow {
7373

7474
output {
7575
samples {
76-
path '.'
76+
path { id, _quant, _fastqc -> "${workflow.outputDir}/${id}" }
7777
index {
7878
path 'index.json'
7979
mapper { id, quant, fastqc ->

modules/fastqc/main.nf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ process FASTQC {
77
tuple val(sample_id), path(fastq_1), path(fastq_2)
88

99
output:
10-
tuple val(sample_id), path("fastqc_${sample_id}_logs"), emit: logs
10+
tuple val(sample_id), path('fastqc')
1111

1212
script:
1313
"""
14-
fastqc.sh "$sample_id" "$fastq_1 $fastq_2"
14+
fastqc.sh "$fastq_1 $fastq_2"
1515
"""
1616
}

modules/quant/main.nf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ process QUANT {
88
tuple val(sample_id), path(fastq_1), path(fastq_2)
99

1010
output:
11-
tuple val(sample_id), path(sample_id)
11+
tuple val(sample_id), path('quant')
1212

1313
script:
1414
"""
15-
salmon quant --threads $task.cpus --libType=U -i $index -1 ${fastq_1} -2 ${fastq_2} -o $sample_id
15+
salmon quant --threads $task.cpus --libType=U -i $index -1 ${fastq_1} -2 ${fastq_2} -o quant
1616
"""
1717
}

0 commit comments

Comments
 (0)