Skip to main content

Global namespace

The global namespace contains globally available constants and functions.

Constants

baseDir: Path

Alias of workflow.projectDir.

launchDir: Path

Alias of workflow.launchDir.

moduleDir: Path

Directory where a module script is located (equivalent to projectDir if used in the main script).

params

Map of workflow parameters specified in the config file or as command line options.

projectDir: Path

Alias of workflow.projectDir.

secrets: Map<String,String>
Added in version 24.04

Map of pipeline secrets. See Secrets for more information.

workDir: Path

Alias of workflow.workDir.

Functions

branchCriteria( criteria: Closure ) -> Closure

Create a branch criteria to use with the branch operator.

env( name: String ) -> String
Added in version 25.04

Get the value of the environment variable with the specified name in the Nextflow launch environment.

error( message: String = null )

Throw a script runtime error with an optional error message.

exit( exitCode: int = 0, message: String = null )
Deprecated in version 22.10

Use error() instead

Stop the pipeline execution and return an exit code and optional error message.

file( filePattern: String, [options] ) -> Path | List<Path>

Get a file from a file name or glob pattern. Returns a collection of files if the glob pattern yields zero or multiple files.

Available options:

checkIfExists: boolean

When true, throws an exception if the specified path does not exist in the file system (default: false).

When true, follows symbolic links when traversing a directory tree, otherwise treats them as files (default: true).

glob: boolean

When true, interprets characters *, ?, [] and {} as glob wildcards, otherwise handles them as normal characters (default: true).

hidden: boolean

When true, includes hidden files in the resulting paths (default: false).

maxDepth: int

Maximum number of directory levels to visit (default: no limit).

type: String

Type of paths returned, can be 'file', 'dir' or 'any' (default: 'file').

See also: channel.fromPath.

files( filePattern: String, [options] ) -> Iterable<Path>

Get a collection of files from a file name or glob pattern. Supports the same options as file().

groupKey( key, size: int ) -> GroupKey

Create a grouping key to use with the groupTuple operator.

multiMapCriteria( criteria: Closure ) -> Closure

Create a multi-map criteria to use with the multiMap operator.

Print a value to standard output.

printf( format: String, values... )

Print a formatted string with the given values to standard output.

println( value )

Print a value to standard output with a newline.

sendMail( [options] )

Send an email. See Notifications for more information.

sleep( milliseconds: long )

Sleep for the given number of milliseconds.

record( [options] ) -> Record

Create a record from the given named arguments.

tuple( collection: List ) -> ArrayTuple

Create a tuple from the given arguments.

On this Page