Skip to content

Instantly share code, notes, and snippets.

@yfarjoun
Created February 27, 2025 04:13
Show Gist options
  • Save yfarjoun/7a6afa7604ae51c705e21c4724b89630 to your computer and use it in GitHub Desktop.
Save yfarjoun/7a6afa7604ae51c705e21c4724b89630 to your computer and use it in GitHub Desktop.
Nextflow workflow with env output
process countStuff{
input: path(input_file)
output:
env('lines'), emit: lines
env('chars'), emit: chars
env('words'), emit: words
script:
"""
lines=\$(wc -l <${input_file})
chars=\$(wc -c <${input_file})
words=\$(wc -w <${input_file})
"""
}
workflow {
countStuff(params.input)
countStuff.out.lines.view { result -> println "Number of rows: $result" }
countStuff.out.chars.view { result -> println "Number of chars: $result" }
countStuff.out.words.view { result -> println "Number of words: $result" }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment