We have released version 1.1 of the NextflowWorkbench. This major release follows the previous bug fix releases 1.0.1 and 1.0.2. We have continued adding features to the IDE to match the latest version of Nextflow. This post describes key new features:
Support for Closures
Many functions offered by Nextflow accept a closure as parameter. For instance, the view function accepts an optional closure to determine what should be printed to the console when the channel on the left side of view emits a value. For instance, a closure is shown in the following code fragment:
You can add the closure on the view function by pressing return over the <no closure> text. New closures are determined according to the type of the argument and the function where they are used, so in this case, the closure inside the view function will be created with an int argument called numsCopy. You just need to enter the body of the closure without having to remember the specific syntax for closure definition.
Support for Tuples
We have improved support for tuples, so that you can now use them inside closures and refer to their elements in a natural way inside the closure. For instance:
Support for Constants
Constants are a handy way to define a value that will be used across several process executions. To define a constant at the top of a workflow, define a new input name and remove the right-part (list definition : ). Type constant instead and proceed to define the value of the constant. For instance, the following defines a channel with three values, and one constant:
The AcceptTwoInts process will be executed three times because the constant value does not affect the number of times a process can run.
Improved Workflow Run Configuration
We have extended run configurations (the dialog that you see when you request the execution of a workflow), to offer command line parameters and a resume execution option.
The resume option causes Nextflow to use cached values for process execution steps that succeeded in prior executions. Using command line parameters is described in the next section.
Support for Workflow Parameters
This release supports workflow parameters. Here’s an example:
Notice that you can provide a default value to the parameter. Use –alpha on the command line when running the workflow to set the value of the alpha parameter to a value other than the default.
Support for most Nextflow functions
This release supports most functions offered by Nextflow, whether they require closures, regular expressions or are just plain functions. You can find many examples of function uses in GitHub, which we have created as test cases of these language constructs: