Skip to content

Instantly share code, notes, and snippets.

@dtrudg
Created September 30, 2016 13:57
Show Gist options
  • Save dtrudg/7f1104d77bcd86335272b7f4892c26eb to your computer and use it in GitHub Desktop.
Save dtrudg/7f1104d77bcd86335272b7f4892c26eb to your computer and use it in GitHub Desktop.
SLURM requeue test
// Path to an input file, or a pattern for multiple inputs
// Note - $baseDir is the location of this workflow file main.nf
params.story = "$baseDir/../test_data/mobydick.txt"
stories = Channel.fromPath( params.story )
process uppercase {
cpus 1
input:
file story from stories
output:
file "${story.name}.uppercase" into uppercased
"""
cat "$story" | tr "[a-z]" "[A-Z]" > "${story.name}.uppercase"
"""
}
process tolines {
cpus 1
input:
file uppercase from uppercased
output:
file "${uppercase.name}.tolines" into tolines
"""
cat "$uppercase" | tr -cs "A-Z'" "\012" > "${uppercase.name}.tolines"
sleep 3600
"""
}
process wordcounts {
// Publish the outputs we create here into the workflow output directory
publishDir "$baseDir/output", mode: 'copy'
input:
file wordlines from tolines
output:
file "${wordlines.name}.wordcount"
"""
cat "$wordlines" | sort | uniq -c | sort -n -r > "${wordlines.name}.wordcount"
"""
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment