Skip to content

Commit

Permalink
added workflow.onComplete/onError snippet, updated init and illumina …
Browse files Browse the repository at this point in the history
…snippets
  • Loading branch information
peterk87 committed Mar 27, 2019
1 parent 93b2603 commit 04f0e77
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ Nextflow syntax highlighting extends Sublime Text 3's Groovy syntax with highlig
- `cpus`: insert "${task.cpus}" into a script
- `script_path`: specify user script (e.g. Python script) to use from `scripts/` directory in workflow base directory
- `info`: `log.info` snippet
- `done`: on workflow complete or error message
1 change: 1 addition & 0 deletions messages/install.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Snippets:
- cpus: insert "${task.cpus}" into a script
- script_path: specify user script (e.g. Python script) to use from scripts/ directory in workflow base directory
- info: log.info snippet
- done: on workflow complete or error message


Nextflow syntax highlighting extends Sublime Text 3's Groovy syntax with highlighting of:
Expand Down
22 changes: 22 additions & 0 deletions nextflow-done-log-oncomplete-onerror.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<snippet>
<content><![CDATA[
workflow.onComplete {
println """
Pipeline execution summary
---------------------------
Completed at : \${workflow.complete}
Duration : \${workflow.duration}
Success : \${workflow.success}
Results Dir : \${file(params.outdir)}
Work Dir : \${workflow.workDir}
Exit status : \${workflow.exitStatus}
Error report : \${workflow.errorReport ?: '-'}
""".stripIndent()
}
workflow.onError {
println "Oops... Pipeline execution stopped with the following message: \${workflow.errorMessage}"
}
]]></content>
<tabTrigger>done</tabTrigger>
<scope>source.nextflow - meta.definition.process.nextflow</scope>
</snippet>
4 changes: 1 addition & 3 deletions nextflow-init.sublime-snippet
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
#!/usr/bin/env nextflow
params.outdir = "\$baseDir/results"
params.$1 = $2
params.$3 = $4
params.${1:reads} = ${2:"\$baseDir/reads/*R{1,2\}*.fastq.gz"}
outdir = params.outdir
Expand All @@ -21,7 +20,6 @@ def helpMessage() {
nextflow run ${workflow.manifest.name} -profile standard --outdir /output/path
Options:
--$1 Help message for "$1" (default: $2)
--$3 Help message for "$3" (default: $4)
Other options:
--outdir The output directory where the results will be saved (default: \$outdir)
-w/--work-dir The temporary directory where intermediate data will be saved
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Channel
.fromFilePairs( ${1:params.reads}, ${2:flat: true})
.map { [ it[0].replaceAll(/_S\d{1,2}_L001/, ""), it[1], it[2] ] }
.set { ${3:samples_ch} }
.set { ${3:ch_reads} }
]]></content>
<tabTrigger>illumina</tabTrigger>
<scope>source.nextflow - meta.definition.process.nextflow</scope>
Expand Down

0 comments on commit 04f0e77

Please sign in to comment.