Skip to content

Commit

Permalink
Fix workflow outputs
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Sherman <[email protected]>
  • Loading branch information
bentsherman committed Dec 5, 2024
1 parent 26c43af commit 9e33149
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
14 changes: 6 additions & 8 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,12 @@ workflow {

output {
samples {
path { _meta, _fastq, _md5 ->
{ file ->
def dir = [
'fastq': 'fastq',
'md5': 'fastq/md5'
][file.ext]
"${dir}/${file.baseName}"
}
path { _sample ->
def dirs = [
'fastq': 'fastq',
'md5': 'fastq/md5'
]
return { file -> "${dirs[file.extension]}/${file.name}" }
}
index {
path 'samplesheet/samplesheet.json'
Expand Down
4 changes: 1 addition & 3 deletions workflows/sra/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,12 @@ workflow SRA {
.map {
meta, fastq, md5 ->
def reads = fastq instanceof List ? fastq.flatten() : [ fastq ]
def meta_clone = meta + [
meta + [
fastq_1: reads[0],
fastq_2: reads[1] && !meta.single_end ? reads[1] : null,
md5_1: md5[0],
md5_2: md5[1] && !meta.single_end ? md5[1] : null,
]

return [ meta_clone, reads, md5 ]
}
}
else {
Expand Down

0 comments on commit 9e33149

Please sign in to comment.