Skip to content

Commit

Permalink
Refactor output directory structure
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Sherman <[email protected]>
  • Loading branch information
bentsherman committed Oct 29, 2024
1 parent 642dbad commit b0c2f87
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
7 changes: 3 additions & 4 deletions bin/fastqc.sh
Original file line number Diff line number Diff line change
@@ -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}
2 changes: 1 addition & 1 deletion main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ workflow {

output {
samples {
path '.'
path { id, _quant, _fastqc -> "${workflow.outputDir}/${id}" }
index {
path 'index.json'
mapper { id, quant, fastqc ->
Expand Down
4 changes: 2 additions & 2 deletions modules/fastqc/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
"""
}
4 changes: 2 additions & 2 deletions modules/quant/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""
}

0 comments on commit b0c2f87

Please sign in to comment.