Skip to content

Summary log

paramsSummaryLog()

This function returns a string that can be logged to the terminal, summarizing the parameters provided to the pipeline.

Note

The summary prioritizes displaying only the parameters that are different than the default schema values. Parameters which don't have a default in the JSON Schema and which have a value of null, "", false or 'false' won't be returned in the map. This is to streamline the extensive parameter lists often associated with pipelines, and highlight the customized elements. This feature is essential for users to verify their configurations, like checking for typos or confirming proper resolution, without wading through an array of default settings.

The function takes two arguments:

  • The WorkflowMetadata object, workflow (required)
  • File name of a schema file (optional, default: nextflow_schema.json).

Typical usage:

include { paramsSummaryLog } from 'plugin/nf-schema'

workflow {
    log.info paramsSummaryLog(workflow)
}
plugins {
  id 'nf-schema@2.5.1'
}

params {
  input = "samplesheet.csv"
  outdir = "results"
}

validation {
  summary {
    beforeText = """
This is a summary message for the pipeline parameters.
    """
    afterText = """
For more information, please refer to the documentation.
    """
  }
}
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://raw.githubusercontent.com/nf-core/testpipeline/master/nextflow_schema.json",
    "title": "nf-core/testpipeline pipeline parameters",
    "description": "this is a test",
    "type": "object",
    "$defs": {
        "input_output_options": {
            "title": "Input/output options",
            "type": "object",
            "fa_icon": "fas fa-terminal",
            "description": "Define where the pipeline should find input data and save output data.",
            "required": ["input", "outdir"],
            "properties": {
                "input": {
                    "type": "string",
                    "format": "file-path",
                    "mimetype": "text/csv",
                    "schema": "assets/schema_input.json",
                    "pattern": "^\\S+\\.(csv|tsv|yaml|json)$",
                    "description": "Path to comma-separated file containing information about the samples in the experiment.",
                    "help_text": "You will need to create a design file with information about the samples in your experiment before running the pipeline. Use this parameter to specify its location. It has to be a comma-separated file with 3 columns, and a header row. See [usage docs](https://nf-co.re/testpipeline/usage#samplesheet-input).",
                    "fa_icon": "fas fa-file-csv"
                },
                "outdir": {
                    "type": "string",
                    "format": "directory-path",
                    "description": "The output directory where the results will be saved. You have to use absolute paths to storage on Cloud infrastructure.",
                    "fa_icon": "fas fa-folder-open"
                }
            }
        }
    },
    "allOf": [
        {
            "$ref": "#/$defs/input_output_options"
        }
    ]
}

Output:

 N E X T F L O W   ~  version 25.04.0

Launching `pipeline/main.nf` [angry_poitras] DSL2 - revision: fca518be2f


This is a summary message for the pipeline parameters.
    Input/output options
  input      : samplesheet.csv
  outdir     : results

Core Nextflow options
  runName    : angry_poitras
  launchDir  : /home/nvnieuwk/Documents/nextflow/nf-schema/examples/paramsSummaryLog
  workDir    : /home/nvnieuwk/Documents/nextflow/nf-schema/examples/paramsSummaryLog/work
  projectDir : /home/nvnieuwk/Documents/nextflow/nf-schema/examples/paramsSummaryLog/pipeline
  userName   : nvnieuwk
  profile    : standard
  configFiles: /home/nvnieuwk/.nextflow/config, /home/nvnieuwk/Documents/nextflow/nf-schema/examples/paramsSummaryLog/pipeline/nextflow.config

!! Only displaying parameters that differ from the pipeline defaults !!
------------------------------------------------------
For more information, please refer to the documentation.

Coloured logs

By default, the summary output is coloured using ANSI escape codes.

If you prefer, you can disable these by using the argument monochrome_logs, e.g. paramsHelp(monochrome_logs: true). Alternatively this can be set at a global level via parameter --monochrome_logs or adding params.monochrome_logs = true to a configuration file. Not --monochromeLogs or params.monochromeLogs is also supported.

Default summary logs

Default summary logs

paramsSummaryMap()

This function returns a Groovy Map summarizing parameters/workflow options used by the pipeline. As above, it only returns the provided parameters that are different to the default values.

This function takes the same arguments as paramsSummaryLog(): the workflow object and an optional schema file path.

Note

Parameters which don't have a default in the JSON Schema and which have a value of null, "", false or 'false' won't be returned in the map.

Typical usage:

include { paramsSummaryMap } from 'plugin/nf-schema'

workflow {
    paramsMap = paramsSummaryMap(workflow)
    prettyPrint(paramsMap)
}


def prettyPrint(map, indent=0) {
    map.each { k, v ->
        if(v instanceof Map) {
            println("${'  ' * indent}${k}:")
            prettyPrint(v, indent+1)
        } else {
            println("${'  ' * indent}${k}:${v}")
        }
    }
}
plugins {
  id 'nf-schema@2.5.1'
}

params {
  input = "samplesheet.csv"
  outdir = "results"
}
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://raw.githubusercontent.com/nf-core/testpipeline/master/nextflow_schema.json",
    "title": "nf-core/testpipeline pipeline parameters",
    "description": "this is a test",
    "type": "object",
    "$defs": {
        "input_output_options": {
            "title": "Input/output options",
            "type": "object",
            "fa_icon": "fas fa-terminal",
            "description": "Define where the pipeline should find input data and save output data.",
            "required": ["input", "outdir"],
            "properties": {
                "input": {
                    "type": "string",
                    "format": "file-path",
                    "mimetype": "text/csv",
                    "schema": "assets/schema_input.json",
                    "pattern": "^\\S+\\.(csv|tsv|yaml|json)$",
                    "description": "Path to comma-separated file containing information about the samples in the experiment.",
                    "help_text": "You will need to create a design file with information about the samples in your experiment before running the pipeline. Use this parameter to specify its location. It has to be a comma-separated file with 3 columns, and a header row. See [usage docs](https://nf-co.re/testpipeline/usage#samplesheet-input).",
                    "fa_icon": "fas fa-file-csv"
                },
                "outdir": {
                    "type": "string",
                    "format": "directory-path",
                    "description": "The output directory where the results will be saved. You have to use absolute paths to storage on Cloud infrastructure.",
                    "fa_icon": "fas fa-folder-open"
                }
            }
        }
    },
    "allOf": [
        {
            "$ref": "#/$defs/input_output_options"
        }
    ]
}

Output:

 N E X T F L O W   ~  version 25.04.6

Launching `examples/paramsSummaryMap/pipeline/main.nf` [big_spence] DSL2 - revision: 7e4bad0a5e

Input/output options:
  input:samplesheet.csv
  outdir:results
Core Nextflow options:
  runName:big_spence
  launchDir:/home/nvnieuwk/Documents/nextflow/nf-schema
  workDir:/home/nvnieuwk/Documents/nextflow/nf-schema/work
  projectDir:/home/nvnieuwk/Documents/nextflow/nf-schema/examples/paramsSummaryMap/pipeline
  userName:nvnieuwk
  profile:standard
  configFiles:/home/nvnieuwk/.nextflow/config, /home/nvnieuwk/Documents/nextflow/nf-schema/examples/paramsSummaryMap/pipeline/nextflow.config