Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add publish_dir_mode param to pipeline template #587

Merged
merged 5 commits into from
Mar 16, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## v1.10dev

### Template

* Add `--publish_dir_mode` parameter [#585](https://github.com/nf-core/tools/issues/585)

### Linting

* Refactored PR branch tests to be a little clearer.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
* [`--awscli`](#--awscli)
* [Other command line parameters](#other-command-line-parameters)
* [`--outdir`](#--outdir)
* [`--publish_dir_mode`](#--publish_dir_mode)
* [`--email`](#--email)
* [`--email_on_fail`](#--email_on_fail)
* [`--max_multiqc_email_size`](#--max_multiqc_email_size)
Expand Down Expand Up @@ -237,6 +238,10 @@ Please make sure to also set the `-w/--work-dir` and `--outdir` parameters to a

The output directory where the results will be saved.

### `--publish_dir_mode`

Value passed to Nextflow [`publishDir`](https://www.nextflow.io/docs/latest/process.html#publishdir) directive for publishing results in the output directory. Available: 'symlink', 'rellink', 'link', 'copy', 'copyNoFollow' and 'move' (Default: 'copy').

### `--email`

Set this parameter to your e-mail address to get a summary e-mail with details of the run sent to you when the workflow exits. If set in your user config file (`~/.nextflow/config`) then you don't need to specify this on the command line for every run.
Expand Down
12 changes: 7 additions & 5 deletions nf_core/pipeline-template/{{cookiecutter.name_noslash}}/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def helpMessage() {

Other options:
--outdir [file] The output directory where the results will be saved
--publish_dir_mode [str] Mode for publishing results in the output directory. Available: symlink, rellink, link, copy, copyNoFollow, move (Default: copy)
--email [email] Set this parameter to your e-mail address to get a summary e-mail with details of the run sent to you when the workflow exits
--email_on_fail [email] Same as --email, except only send mail if the workflow is not successful
--max_multiqc_email_size [str] Theshold size for MultiQC report to be attached in notification email. If file generated by pipeline exceeds the threshold, it will not be attached (Default: 25MB)
Expand Down Expand Up @@ -73,12 +74,13 @@ params.fasta = params.genome ? params.genomes[ params.genome ].fasta ?: false :
if (params.fasta) { ch_fasta = file(params.fasta, checkIfExists: true) }

// Has the run name been specified by the user?
// this has the bonus effect of catching both -name and --name
// this has the bonus effect of catching both -name and --name
custom_runName = params.name
if (!(workflow.runName ==~ /[a-z]+_[a-z]+/)) {
custom_runName = workflow.runName
}

// AWS batch settings
if (workflow.profile.contains('awsbatch')) {
// AWSBatch sanity checking
if (!params.awsqueue || !params.awsregion) exit 1, "Specify correct --awsqueue and --awsregion parameters on AWSBatch!"
Expand Down Expand Up @@ -174,7 +176,7 @@ Channel.from(summary.collect{ [it.key, it.value] })
* Parse software version numbers
*/
process get_software_versions {
publishDir "${params.outdir}/pipeline_info", mode: 'copy',
publishDir "${params.outdir}/pipeline_info", mode: params.publish_dir_mode,
saveAs: { filename ->
if (filename.indexOf(".csv") > 0) filename
else null
Expand All @@ -201,7 +203,7 @@ process get_software_versions {
process fastqc {
tag "$name"
label 'process_medium'
publishDir "${params.outdir}/fastqc", mode: 'copy',
publishDir "${params.outdir}/fastqc", mode: params.publish_dir_mode,
saveAs: { filename ->
filename.indexOf(".zip") > 0 ? "zips/$filename" : "$filename"
}
Expand All @@ -222,7 +224,7 @@ process fastqc {
* STEP 2 - MultiQC
*/
process multiqc {
publishDir "${params.outdir}/MultiQC", mode: 'copy'
publishDir "${params.outdir}/MultiQC", mode: params.publish_dir_mode

input:
file (multiqc_config) from ch_multiqc_config
Expand Down Expand Up @@ -251,7 +253,7 @@ process multiqc {
* STEP 3 - Output Description HTML
*/
process output_documentation {
publishDir "${params.outdir}/pipeline_info", mode: 'copy'
publishDir "${params.outdir}/pipeline_info", mode: params.publish_dir_mode

input:
file output_docs from ch_output_docs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ params {
reads = "data/*{1,2}.fastq.gz"
single_end = false
outdir = './results'
publish_dir_mode = 'copy'

// Boilerplate options
name = false
Expand Down