Skip to content

Instantly share code, notes, and snippets.

@robsyme
Created December 9, 2022 20:13
Show Gist options
  • Save robsyme/20dd6ed0e69968065e7552847a7fa4e3 to your computer and use it in GitHub Desktop.
Save robsyme/20dd6ed0e69968065e7552847a7fa4e3 to your computer and use it in GitHub Desktop.
#!/usr/bin/env nextflow
nextflow.enable.dsl=2
nextflow.preview.recursion=true
params.input = 'data/*.dat'
process ScannerLightly {
input:
path datfile_accumulator
val meta_accumulator
output:
path "add_me_to_list.*.txt", emit: txts
val new_sampleid, emit: ids
script:
println "datfile_accumulator: ${datfile_accumulator}"
println "meta_accumulator: ${meta_accumulator}"
new_sampleid = meta_accumulator.first()
"echo adding $new_sampleid > add_me_to_list.${new_sampleid}.txt"
}
workflow {
Channel.fromPath(params.input)
| toSortedList
| flatten
| multiMap {
datfiles: it
sampleid: it.simpleName
}
| set { two_input_channels }
ScannerLightly.scan(two_input_channels)
ScannerLightly.out.txts | view
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment