Created
March 28, 2024 22:11
-
-
Save robsyme/07e79bbe6789f08f2320c7f2715e0669 to your computer and use it in GitHub Desktop.
Publication behaviour example
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 | |
params.outdir = 'results' | |
params.all = false | |
workflow { | |
First() | |
First.out.value | Second | |
Second.out.value | Third | |
} | |
process First { | |
publishDir params.outdir | |
container 'quay.io/nextflow/bash' | |
output: | |
val(1), emit: value | |
path('*'), emit: files | |
script: | |
makeAll = params.all ? "echo 1 > my-folder/all.txt" : "" | |
""" | |
mkdir -p my-folder/subfolder1/subsub | |
${makeAll} | |
echo 1 > my-folder/subfolder1/1.txt | |
""" | |
} | |
process Second { | |
publishDir params.outdir | |
container 'quay.io/nextflow/bash' | |
input: | |
val(x) | |
output: | |
val(x), emit: value | |
path('*'), emit: files | |
script: | |
makeAll = params.all ? "echo 12 > my-folder/all.txt" : "" | |
""" | |
mkdir -p my-folder/subfolder2/subsub | |
${makeAll} | |
echo 2 > my-folder/subfolder2/2.txt | |
""" | |
} | |
process Third { | |
publishDir params.outdir | |
container 'quay.io/nextflow/bash' | |
input: | |
val(x) | |
output: | |
path('*') | |
script: | |
makeAll = params.all ? "echo 123 > my-folder/all.txt" : "" | |
""" | |
mkdir -p my-folder/subfolder3/subsub | |
${makeAll} | |
echo 3 > my-folder/subfolder3/3.txt | |
""" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment