Skip to content

Commit

Permalink
minor edits
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 768702d commit 8f97ac6
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions workflows/sra/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ workflow SRA {
.unique()
.set { ch_sra_metadata }

ch_samples = Channel.empty()
if (!skip_fastq_download) {

ch_sra_metadata
Expand Down Expand Up @@ -124,17 +123,19 @@ workflow SRA {
.map {
meta, fastq, md5 ->
def reads = fastq instanceof List ? fastq.flatten() : [ fastq ]
def meta_clone = meta.clone()

meta_clone.fastq_1 = reads[0]
meta_clone.fastq_2 = reads[1] && !meta.single_end ? reads[1] : null

meta_clone.md5_1 = md5[0]
meta_clone.md5_2 = md5[1] && !meta.single_end ? md5[1] : null

return meta_clone
def meta_clone = 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 {
ch_samples = Channel.empty()
}

emit:
samples = ch_samples
Expand Down

0 comments on commit 8f97ac6

Please sign in to comment.