Created
December 9, 2022 20:13
-
-
Save robsyme/20dd6ed0e69968065e7552847a7fa4e3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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