From ad9431f490aa0dc070c79814af9b26bf8cb039b7 Mon Sep 17 00:00:00 2001 From: Phil Ewels Date: Wed, 13 Mar 2019 11:50:54 +0100 Subject: [PATCH 1/6] Remove singularity badge on template readme --- .../pipeline-template/{{cookiecutter.name_noslash}}/README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/README.md b/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/README.md index 1f43ce49b7..1f8cc81504 100644 --- a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/README.md +++ b/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/README.md @@ -7,8 +7,6 @@ [![install with bioconda](https://img.shields.io/badge/install%20with-bioconda-brightgreen.svg)](http://bioconda.github.io/) [![Docker](https://img.shields.io/docker/automated/{{ cookiecutter.name_docker }}.svg)](https://hub.docker.com/r/{{ cookiecutter.name_docker }}) -![Singularity Container available]( -https://img.shields.io/badge/singularity-available-7E4C74.svg) ## Introduction The pipeline is built using [Nextflow](https://www.nextflow.io), a workflow tool to run tasks across multiple compute infrastructures in a very portable manner. It comes with docker / singularity containers making installation trivial and results highly reproducible. From 408ee02cfc517ea9a0e66af9a2d22dcb7ac8bebe Mon Sep 17 00:00:00 2001 From: Phil Ewels Date: Wed, 13 Mar 2019 17:25:37 +0100 Subject: [PATCH 2/6] Template: Porting over improvements from comparison with rnaseq pipeline --- .../{conf => assets}/multiqc_config.yaml | 0 .../assets/sendmail_template.txt | 31 ++++- .../conf/awsbatch.config | 7 +- .../conf/base.config | 2 +- .../docs/installation.md | 49 ++++---- .../docs/usage.md | 37 +++--- .../environment.yml | 2 + .../{{cookiecutter.name_noslash}}/main.nf | 110 +++++++++++++----- .../nextflow.config | 8 +- 9 files changed, 170 insertions(+), 76 deletions(-) rename nf_core/pipeline-template/{{cookiecutter.name_noslash}}/{conf => assets}/multiqc_config.yaml (100%) diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/conf/multiqc_config.yaml b/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/assets/multiqc_config.yaml similarity index 100% rename from nf_core/pipeline-template/{{cookiecutter.name_noslash}}/conf/multiqc_config.yaml rename to nf_core/pipeline-template/{{cookiecutter.name_noslash}}/assets/multiqc_config.yaml diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/assets/sendmail_template.txt b/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/assets/sendmail_template.txt index fd1cd7396e..2d67122006 100644 --- a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/assets/sendmail_template.txt +++ b/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/assets/sendmail_template.txt @@ -1,11 +1,36 @@ To: $email Subject: $subject Mime-Version: 1.0 -Content-Type: multipart/related;boundary="nfmimeboundary" +Content-Type: multipart/related;boundary="nfcoremimeboundary" ---nfmimeboundary +--nfcoremimeboundary Content-Type: text/html; charset=utf-8 $email_html ---nfmimeboundary-- +<% +if (mqcFile){ +def mqcFileObj = new File("$mqcFile") +if (mqcFileObj.length() < mqcMaxSize){ +out << """ +--nfcoremimeboundary +Content-Type: text/html; name=\"multiqc_report\" +Content-Transfer-Encoding: base64 +Content-ID: +Content-Disposition: attachment; filename=\"${mqcFileObj.getName()}\" + +${mqcFileObj. + bytes. + encodeBase64(). + toString(). + tokenize( '\n' )*. + toList()*. + collate( 76 )*. + collect { it.join() }. + flatten(). + join( '\n' )} +""" +}} +%> + +--nfcoremimeboundary-- diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/conf/awsbatch.config b/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/conf/awsbatch.config index c925f7e064..14af5866f5 100644 --- a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/conf/awsbatch.config +++ b/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/conf/awsbatch.config @@ -1,4 +1,9 @@ -//Profile config names for awsbatch profile +/* + * ------------------------------------------------- + * Nextflow config file for running on AWS batch + * ------------------------------------------------- + * Base config needed for running with -profile awsbatch + */ params { config_profile_name = 'AWSBATCH' config_profile_description = 'AWSBATCH Cloud Profile' diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/conf/base.config b/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/conf/base.config index 5f6384cf3c..2487563553 100644 --- a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/conf/base.config +++ b/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/conf/base.config @@ -16,7 +16,7 @@ process { memory = { check_max( 8.GB * task.attempt, 'memory' ) } time = { check_max( 2.h * task.attempt, 'time' ) } - errorStrategy = { task.exitStatus in [143,137] ? 'retry' : 'finish' } + errorStrategy = { task.exitStatus in [143,137,104,134,139] ? 'retry' : 'finish' } maxRetries = 1 maxErrors = '-1' diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/docs/installation.md b/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/docs/installation.md index 267255ac7b..114258376f 100644 --- a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/docs/installation.md +++ b/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/docs/installation.md @@ -2,18 +2,22 @@ To start using the {{ cookiecutter.name }} pipeline, follow the steps below: -1. [Install Nextflow](#1-install-nextflow) -2. [Install the pipeline](#2-install-the-pipeline) - * [Automatic](#21-automatic) - * [Offline](#22-offline) - * [Development](#23-development) -3. [Pipeline configuration](#3-pipeline-configuration) - * [Software deps: Docker and Singularity](#31-software-deps-docker-and-singularity) - * [Software deps: Bioconda](#32-software-deps-bioconda) - * [Configuration profiles](#33-configuration-profiles) -4. [Reference genomes](#4-reference-genomes) - -## 1) Install NextFlow + + +* [Install NextFlow](#install-nextflow) +* [Install the pipeline](#install-the-pipeline) + * [Automatic](#automatic) + * [Offline](#offline) + * [Development](#development) +* [Pipeline configuration](#pipeline-configuration) + * [Docker](#docker) + * [Singularity](#singularity) + * [Conda](#conda) + * [Configuration profiles](#configuration-profiles) +* [Reference genomes](#reference-genomes) + + +## Install NextFlow Nextflow runs on most POSIX systems (Linux, Mac OSX etc). It can be installed by running the following commands: ```bash @@ -31,12 +35,12 @@ mv nextflow ~/bin/ See [nextflow.io](https://www.nextflow.io/) for further instructions on how to install and configure Nextflow. -## 2) Install the pipeline +## Install the pipeline -#### 2.1) Automatic +### Automatic This pipeline itself needs no installation - NextFlow will automatically fetch it from GitHub if `{{ cookiecutter.name }}` is specified as the pipeline name. -#### 2.2) Offline +### Offline The above method requires an internet connection so that Nextflow can download the pipeline files. If you're running on a system that has no internet connection, you'll need to download and transfer the pipeline files manually: ```bash @@ -53,12 +57,12 @@ To stop nextflow from looking for updates online, you can tell it to run in offl export NXF_OFFLINE='TRUE' ``` -#### 2.3) Development +### Development If you would like to make changes to the pipeline, it's best to make a fork on GitHub and then clone the files. Once cloned you can run the pipeline directly as above. -## 3) Pipeline configuration +## Pipeline configuration By default, the pipeline loads a basic server configuration [`conf/base.config`](../conf/base.config) This uses a number of sensible defaults for process requirements and is suitable for running on a simple (if powerful!) local server. @@ -71,12 +75,12 @@ Be warned of two important points about this default configuration: 2. Nextflow will expect all software to be installed and available on the `PATH` * It's expected to use an additional config profile for docker, singularity or conda support. See below. -#### 3.1) Software deps: Docker +### Docker First, install docker on your system: [Docker Installation Instructions](https://docs.docker.com/engine/installation/) Then, running the pipeline with the option `-profile docker` tells Nextflow to enable Docker for this run. An image containing all of the software requirements will be automatically fetched and used from dockerhub (https://hub.docker.com/r/{{ cookiecutter.name_docker }}). -#### 3.1) Software deps: Singularity +### Singularity If you're not able to use Docker then [Singularity](http://singularity.lbl.gov/) is a great alternative. The process is very similar: running the pipeline with the option `-profile singularity` tells Nextflow to enable singularity for this run. An image containing all of the software requirements will be automatically fetched and used from singularity hub. @@ -94,17 +98,16 @@ nextflow run /path/to/{{ cookiecutter.name_noslash }} -with-singularity {{ cooki Remember to pull updated versions of the singularity image if you update the pipeline. - -#### 3.2) Software deps: conda +### Conda If you're not able to use Docker _or_ Singularity, you can instead use conda to manage the software requirements. This is slower and less reproducible than the above, but is still better than having to install all requirements yourself! The pipeline ships with a conda environment file and nextflow has built-in support for this. To use it first ensure that you have conda installed (we recommend [miniconda](https://conda.io/miniconda.html)), then follow the same pattern as above and use the flag `-profile conda` -#### 3.3) Configuration profiles +### Configuration profiles See [`docs/configuration/adding_your_own.md`](configuration/adding_your_own.md) -## 4) Reference genomes +## Reference genomes See [`docs/configuration/reference_genomes.md`](configuration/reference_genomes.md) diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/docs/usage.md b/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/docs/usage.md index 3ababd5369..98f0c3f19a 100644 --- a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/docs/usage.md +++ b/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/docs/usage.md @@ -2,46 +2,45 @@ ## Table of contents -* [Introduction](#general-nextflow-info) + + +* [Table of contents](#table-of-contents) +* [Introduction](#introduction) * [Running the pipeline](#running-the-pipeline) -* [Updating the pipeline](#updating-the-pipeline) -* [Reproducibility](#reproducibility) + * [Updating the pipeline](#updating-the-pipeline) + * [Reproducibility](#reproducibility) * [Main arguments](#main-arguments) - * [`-profile`](#-profile-single-dash) - * [`awsbatch`](#awsbatch) - * [`conda`](#conda) - * [`docker`](#docker) - * [`singularity`](#singularity) - * [`test`](#test) + * [`-profile`](#-profile) * [`--reads`](#--reads) * [`--singleEnd`](#--singleend) * [Reference genomes](#reference-genomes) - * [`--genome`](#--genome) + * [`--genome` (using iGenomes)](#--genome-using-igenomes) * [`--fasta`](#--fasta) * [`--igenomesIgnore`](#--igenomesignore) * [Job resources](#job-resources) -* [Automatic resubmission](#automatic-resubmission) -* [Custom resource requests](#custom-resource-requests) -* [AWS batch specific parameters](#aws-batch-specific-parameters) - * [`-awsbatch`](#-awsbatch) + * [Automatic resubmission](#automatic-resubmission) + * [Custom resource requests](#custom-resource-requests) +* [AWS Batch specific parameters](#aws-batch-specific-parameters) * [`--awsqueue`](#--awsqueue) * [`--awsregion`](#--awsregion) * [Other command line parameters](#other-command-line-parameters) * [`--outdir`](#--outdir) * [`--email`](#--email) - * [`-name`](#-name-single-dash) - * [`-resume`](#-resume-single-dash) - * [`-c`](#-c-single-dash) + * [`-name`](#-name) + * [`-resume`](#-resume) + * [`-c`](#-c) * [`--custom_config_version`](#--custom_config_version) + * [`--custom_config_base`](#--custom_config_base) * [`--max_memory`](#--max_memory) * [`--max_time`](#--max_time) * [`--max_cpus`](#--max_cpus) * [`--plaintext_email`](#--plaintext_email) * [`--monochrome_logs`](#--monochrome_logs) * [`--multiqc_config`](#--multiqc_config) + -## General Nextflow info +## Introduction Nextflow handles job submissions on SLURM or other environments, and supervises running the jobs. Thus the Nextflow process must run until the pipeline is finished. We recommend that you put the process running in the background through `screen` / `tmux` or similar tool. Alternatively you can run nextflow within a cluster job submitted your job scheduler. It is recommended to limit the Nextflow Java virtual machines memory. We recommend adding the following line to your environment (typically in `~/.bashrc` or `~./bash_profile`): @@ -210,7 +209,7 @@ Please make sure to also set the `-w/--work-dir` and `--outdir` parameters to a The output directory where the results will be saved. ### `--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 speicfy this on the command line for every run. +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. ### `-name` Name for the pipeline run. If not specified, Nextflow will automatically generate a random mnemonic. diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/environment.yml b/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/environment.yml index 5aafb29c4b..887be185ec 100644 --- a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/environment.yml +++ b/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/environment.yml @@ -1,3 +1,5 @@ +# You can use this file to create a conda environment for this pipeline: +# conda env create -f environment.yml name: {{ cookiecutter.name_noslash }}-{{ cookiecutter.version }} channels: - conda-forge diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/main.nf b/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/main.nf index de42bbe2f5..3e40854b18 100644 --- a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/main.nf +++ b/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/main.nf @@ -23,11 +23,11 @@ def helpMessage() { Mandatory arguments: --reads Path to input data (must be surrounded with quotes) - --genome Name of iGenomes reference -profile Configuration profile to use. Can use multiple (comma separated) Available: conda, docker, singularity, awsbatch, test and more. Options: + --genome Name of iGenomes reference --singleEnd Specifies that the input is single end reads References If not specified in the configuration file or you wish to overwrite any of the references. @@ -36,6 +36,7 @@ def helpMessage() { Other options: --outdir The output directory where the results will be saved --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 + --maxMultiqcEmailFileSize 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) -name Name for the pipeline run. If not specified, Nextflow will automatically generate a random mnemonic. AWSBatch options: @@ -54,6 +55,11 @@ if (params.help){ exit 0 } +// Check if genome exists in the config file +if (params.genomes && params.genome && !params.genomes.containsKey(params.genome)) { + exit 1, "The provided genome '${params.genome}' is not available in the iGenomes file. Currently the available genomes are ${params.genomes.keySet().join(", ")}" +} + // TODO nf-core: Add any reference files that are needed // Configurable reference genomes fasta = params.genome ? params.genomes[ params.genome ].fasta ?: false : false @@ -93,26 +99,26 @@ ch_output_docs = Channel.fromPath("$baseDir/docs/output.md") /* * Create a channel for input read files */ - if(params.readPaths){ - if(params.singleEnd){ - Channel - .from(params.readPaths) - .map { row -> [ row[0], [file(row[1][0])]] } - .ifEmpty { exit 1, "params.readPaths was empty - no input files supplied" } - .into { read_files_fastqc; read_files_trimming } - } else { - Channel - .from(params.readPaths) - .map { row -> [ row[0], [file(row[1][0]), file(row[1][1])]] } - .ifEmpty { exit 1, "params.readPaths was empty - no input files supplied" } - .into { read_files_fastqc; read_files_trimming } - } - } else { - Channel - .fromFilePairs( params.reads, size: params.singleEnd ? 1 : 2 ) - .ifEmpty { exit 1, "Cannot find any reads matching: ${params.reads}\nNB: Path needs to be enclosed in quotes!\nIf this is single-end data, please specify --singleEnd on the command line." } - .into { read_files_fastqc; read_files_trimming } - } +if(params.readPaths){ + if(params.singleEnd){ + Channel + .from(params.readPaths) + .map { row -> [ row[0], [file(row[1][0])]] } + .ifEmpty { exit 1, "params.readPaths was empty - no input files supplied" } + .into { read_files_fastqc; read_files_trimming } + } else { + Channel + .from(params.readPaths) + .map { row -> [ row[0], [file(row[1][0]), file(row[1][1])]] } + .ifEmpty { exit 1, "params.readPaths was empty - no input files supplied" } + .into { read_files_fastqc; read_files_trimming } + } +} else { + Channel + .fromFilePairs( params.reads, size: params.singleEnd ? 1 : 2 ) + .ifEmpty { exit 1, "Cannot find any reads matching: ${params.reads}\nNB: Path needs to be enclosed in quotes!\nIf this is single-end data, please specify --singleEnd on the command line." } + .into { read_files_fastqc; read_files_trimming } +} // Header log info @@ -146,10 +152,16 @@ if(workflow.profile == 'awsbatch'){ summary['AWS Region'] = params.awsregion summary['AWS Queue'] = params.awsqueue } -if(params.email) summary['E-mail Address'] = params.email +if(params.email) { + summary['E-mail Address'] = params.email + summary['MultiQC maxsize'] = params.maxMultiqcEmailFileSize +} log.info summary.collect { k,v -> "${k.padRight(18)}: $v" }.join("\n") log.info "\033[2m----------------------------------------------------\033[0m" +// Check the hostnames against configured profiles +checkHostname() + def create_workflow_summary(summary) { def yaml_file = workDir.resolve('workflow_summary_mqc.yaml') @@ -244,7 +256,7 @@ process multiqc { * STEP 3 - Output Description HTML */ process output_documentation { - publishDir "${params.outdir}/Documentation", mode: 'copy' + publishDir "${params.outdir}/pipeline_info", mode: 'copy' input: file output_docs from ch_output_docs @@ -289,10 +301,26 @@ workflow.onComplete { if(workflow.repository) email_fields['summary']['Pipeline repository Git URL'] = workflow.repository if(workflow.commitId) email_fields['summary']['Pipeline repository Git Commit'] = workflow.commitId if(workflow.revision) email_fields['summary']['Pipeline Git branch/tag'] = workflow.revision + if(workflow.container) email_fields['summary']['Docker image'] = workflow.container email_fields['summary']['Nextflow Version'] = workflow.nextflow.version email_fields['summary']['Nextflow Build'] = workflow.nextflow.build email_fields['summary']['Nextflow Compile Timestamp'] = workflow.nextflow.timestamp + // TODO nf-core: If not using MultiQC, strip out this code (including params.maxMultiqcEmailFileSize) + // On success try attach the multiqc report + def mqc_report = null + try { + if (workflow.success) { + mqc_report = multiqc_report.getVal() + if (mqc_report.getClass() == ArrayList){ + log.warn "[{{ cookiecutter.name }}] Found multiple reports from process 'multiqc', will use only one" + mqc_report = mqc_report[0] + } + } + } catch (all) { + log.warn "[{{ cookiecutter.name }}] Could not attach MultiQC report to summary email" + } + // Render the TXT template def engine = new groovy.text.GStringTemplateEngine() def tf = new File("$baseDir/assets/email_template.txt") @@ -305,7 +333,7 @@ workflow.onComplete { def email_html = html_template.toString() // Render the sendmail template - def smail_fields = [ email: params.email, subject: subject, email_txt: email_txt, email_html: email_html, baseDir: "$baseDir" ] + def smail_fields = [ email: params.email, subject: subject, email_txt: email_txt, email_html: email_html, baseDir: "$baseDir", mqcFile: mqc_report, mqcMaxSize: params.maxMultiqcEmailFileSize.toBytes() ] def sf = new File("$baseDir/assets/sendmail_template.txt") def sendmail_template = engine.createTemplate(sf).make(smail_fields) def sendmail_html = sendmail_template.toString() @@ -325,7 +353,7 @@ workflow.onComplete { } // Write summary e-mail HTML to a file - def output_d = new File( "${params.outdir}/Documentation/" ) + def output_d = new File( "${params.outdir}/pipeline_info/" ) if( !output_d.exists() ) { output_d.mkdirs() } @@ -334,7 +362,16 @@ workflow.onComplete { def output_tf = new File( output_d, "pipeline_report.txt" ) output_tf.withWriter { w -> w << email_txt } - log.info "[{{ cookiecutter.name }}] Pipeline Complete" + c_reset = params.monochrome_logs ? '' : "\033[0m"; + c_purple = params.monochrome_logs ? '' : "\033[0;35m"; + c_green = params.monochrome_logs ? '' : "\033[0;32m"; + c_red = params.monochrome_logs ? '' : "\033[0;31m"; + if(workflow.success){ + log.info "${c_purple}[{{ cookiecutter.name }}]${c_green} Pipeline complete${c_reset}" + } else { + checkHostname() + log.info "${c_purple}[{{ cookiecutter.name }}]${c_red} Pipeline completed with errors${c_reset}" + } } @@ -361,3 +398,24 @@ def nfcoreHeader(){ ${c_dim}----------------------------------------------------${c_reset} """.stripIndent() } + +def checkHostname(){ + def c_reset = params.monochrome_logs ? '' : "\033[0m" + def c_white = params.monochrome_logs ? '' : "\033[0;37m" + def c_red = params.monochrome_logs ? '' : "\033[1;91m" + def c_yellow_bold = params.monochrome_logs ? '' : "\033[1;93m" + if(params.hostnames){ + def hostname = "hostname".execute().text.trim() + params.hostnames.each { prof, hnames -> + hnames.each { hname -> + if(hostname.contains(hname) && !workflow.profile.contains(prof)){ + log.error "====================================================\n" + + " ${c_red}WARNING!${c_reset} You are running with `-profile $workflow.profile`\n" + + " but your machine hostname is ${c_white}'$hostname'${c_reset}\n" + + " ${c_yellow_bold}It's highly recommended that you use `-profile $prof${c_reset}`\n" + + "============================================================" + } + } + } + } +} diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/nextflow.config b/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/nextflow.config index 8970c9096d..71896df174 100644 --- a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/nextflow.config +++ b/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/nextflow.config @@ -3,9 +3,6 @@ * {{ cookiecutter.name }} Nextflow config file * ------------------------------------------------- * Default config options for all environments. - * Cluster-specific config options should be saved - * in the conf folder and imported under a profile - * name here. */ // Global default params, used in configs @@ -21,6 +18,7 @@ params { name = false multiqc_config = "$baseDir/conf/multiqc_config.yaml" email = false + maxMultiqcEmailFileSize = 25.MB plaintext_email = false monochrome_logs = false help = false @@ -32,6 +30,10 @@ params { igenomesIgnore = false custom_config_version = 'master' custom_config_base = "https://raw.githubusercontent.com/nf-core/configs/${params.custom_config_version}" + hostnames = false + config_profile_description = false + config_profile_contact = false + config_profile_url = false } // Container slug. Stable releases should specify release tag! From 62d858627ab8251215ab11e524e2f6b85affa054 Mon Sep 17 00:00:00 2001 From: Phil Ewels Date: Wed, 13 Mar 2019 17:29:12 +0100 Subject: [PATCH 3/6] Changelog --- CHANGELOG.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c04c1e8f0d..a09cae67a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,10 @@ * Brought the logo to life * Change the default filenames for the pipeline trace files * Remote fetch of nf-core/configs profiles fails gracefully if offline -* Remove `process.container` and just directly define `process.container` now. +* Remove `process.container` and just directly define `process.container` now +* Completion email now includes MultiQC report if not too big +* `params.genome` is now checked if set, to ensure that it's a valid iGenomes key +* Together with nf-core/configs, helper function now checks hostname and suggests a valid config profile #### Tools helper code * New `nf-core launch` command to interactively launch nf-core pipelines from command-line From 67f4ea6539fe10dac6e5414f07c2816f09028490 Mon Sep 17 00:00:00 2001 From: Phil Ewels Date: Wed, 13 Mar 2019 17:54:36 +0100 Subject: [PATCH 4/6] Fix markdown lint errors --- .../docs/installation.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/docs/installation.md b/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/docs/installation.md index 114258376f..5475c064c4 100644 --- a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/docs/installation.md +++ b/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/docs/installation.md @@ -2,18 +2,18 @@ To start using the {{ cookiecutter.name }} pipeline, follow the steps below: - - + + * [Install NextFlow](#install-nextflow) * [Install the pipeline](#install-the-pipeline) - * [Automatic](#automatic) - * [Offline](#offline) - * [Development](#development) + * [Automatic](#automatic) + * [Offline](#offline) + * [Development](#development) * [Pipeline configuration](#pipeline-configuration) - * [Docker](#docker) - * [Singularity](#singularity) - * [Conda](#conda) - * [Configuration profiles](#configuration-profiles) + * [Docker](#docker) + * [Singularity](#singularity) + * [Conda](#conda) + * [Configuration profiles](#configuration-profiles) * [Reference genomes](#reference-genomes) From 9571c6eee6fef5c0f37b01a7ad18557ae5c032ed Mon Sep 17 00:00:00 2001 From: Phil Ewels Date: Wed, 13 Mar 2019 18:05:59 +0100 Subject: [PATCH 5/6] params typo --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a09cae67a7..ebc9e087c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ * Brought the logo to life * Change the default filenames for the pipeline trace files * Remote fetch of nf-core/configs profiles fails gracefully if offline -* Remove `process.container` and just directly define `process.container` now +* Remove `params.container` and just directly define `process.container` now * Completion email now includes MultiQC report if not too big * `params.genome` is now checked if set, to ensure that it's a valid iGenomes key * Together with nf-core/configs, helper function now checks hostname and suggests a valid config profile From e1bbfacf55ffe78369d28396de1695b082946c33 Mon Sep 17 00:00:00 2001 From: Phil Ewels Date: Wed, 13 Mar 2019 22:45:26 +0100 Subject: [PATCH 6/6] Changelog version number. Tidy up template summary logs --- CHANGELOG.md | 2 +- .../{{cookiecutter.name_noslash}}/main.nf | 35 +++++++------------ 2 files changed, 14 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ebc9e087c7..a855c19df2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # nf-core/tools: Changelog -## v1.5dev +## [v1.5](https://github.com/nf-core/tools/releases/tag/1.5) - 2019-03-13 Iron Shark #### Template pipeline * Dropped Singularity file diff --git a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/main.nf b/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/main.nf index 3e40854b18..2cad5a6af9 100644 --- a/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/main.nf +++ b/nf_core/pipeline-template/{{cookiecutter.name_noslash}}/main.nf @@ -124,36 +124,28 @@ if(params.readPaths){ // Header log info log.info nfcoreHeader() def summary = [:] -summary['Pipeline Name'] = '{{ cookiecutter.name }}' -summary['Pipeline Version'] = workflow.manifest.version summary['Run Name'] = custom_runName ?: workflow.runName // TODO nf-core: Report custom parameters here summary['Reads'] = params.reads summary['Fasta Ref'] = params.fasta summary['Data Type'] = params.singleEnd ? 'Single-End' : 'Paired-End' -summary['Max Memory'] = params.max_memory -summary['Max CPUs'] = params.max_cpus -summary['Max Time'] = params.max_time -summary['Output Dir'] = params.outdir -summary['Working Dir'] = workflow.workDir -summary['Container Engine'] = workflow.containerEngine -if(workflow.containerEngine) summary['Container'] = workflow.container -summary['Current Home'] = "$HOME" -summary['Current User'] = "$USER" -summary['Current Path'] = "$PWD" -summary['Working Dir'] = workflow.workDir -summary['Output Dir'] = params.outdir -summary['Script Dir'] = workflow.projectDir -summary['Config'] = workflow.profile +summary['Max Resources'] = "$params.max_memory memory, $params.max_cpus cpus, $params.max_time time per job" +if(workflow.containerEngine) summary['Container'] = "$workflow.containerEngine - $workflow.container" +summary['Output dir'] = params.outdir +summary['Launch dir'] = workflow.launchDir +summary['Working dir'] = workflow.workDir +summary['Script dir'] = workflow.projectDir +summary['User'] = workflow.userName +if(workflow.profile == 'awsbatch'){ + summary['AWS Region'] = params.awsregion + summary['AWS Queue'] = params.awsqueue +} +summary['Config Profile'] = workflow.profile if(params.config_profile_description) summary['Config Description'] = params.config_profile_description if(params.config_profile_contact) summary['Config Contact'] = params.config_profile_contact if(params.config_profile_url) summary['Config URL'] = params.config_profile_url -if(workflow.profile == 'awsbatch'){ - summary['AWS Region'] = params.awsregion - summary['AWS Queue'] = params.awsqueue -} if(params.email) { - summary['E-mail Address'] = params.email + summary['E-mail Address'] = params.email summary['MultiQC maxsize'] = params.maxMultiqcEmailFileSize } log.info summary.collect { k,v -> "${k.padRight(18)}: $v" }.join("\n") @@ -162,7 +154,6 @@ log.info "\033[2m----------------------------------------------------\033[0m" // Check the hostnames against configured profiles checkHostname() - def create_workflow_summary(summary) { def yaml_file = workDir.resolve('workflow_summary_mqc.yaml') yaml_file.text = """