Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Nextflow Pipeline

In this tutorial, we will show how to create and launch a pipeline using the Nextflow language in Platform Core.

This tutorial references the Basic pipeline example in the Nextflow documentation.

Create the pipeline

The first step in creating a pipeline is to create a Project. In the example below, the project is named Getting Started.

1

Open your project

Pipelines exist within a Project, so the first step is to determine which project you want to use as home of your pipeline. In the example below, our project is named Getting Started. You can open the project (Projects > your_project) where you want to create your pipeline or create a new project at Projects > + Create.

2

Navigate to the Projects > your_project > Flow > Pipelines inventory

3

Create a new JSON-based pipeline

From the Pipelines view, click +Create > Nextflow > JSON based to start creating the Nextflow pipeline. This will open the pipeline details screen.

4

Configure the general setting

The pipeline details screen is where you give your pipeline a name, description and version number and select your nextflow version and storage size.

Field
Entry

Name

The name by which users can identify your pipeline. The name must be unique within your tenant to prevent users from selecting the wrong pipeline.

Nextflow Version

Select the nextflow version you want to use. For our example, this can be kept at the default version.

Description

A short description of the pipeline.

Status

The release status of the pipeline. This is set to draft as we are editing this pipeline.

Proprietary (optional)

Restricts pipeline scripts and details to users in the owning tenant. Users outside the tenant also cannot clone the pipeline.

Icon

You can keep the default icon or select an alternative from the list of icons.

Version Number

Mandatory version number of your pipeline. Since this is the initial version, we can leave it at 1.0.0

Version Comment (optional)

You can provide additional information for this version of your pipeline here.

Storage size

Select a storage size for running the pipeline. Since this is a very small basic pipeline, the smallest size you can select here will still be large enough.

Links (optional)

Here you can add links to external information by selecting the + icon.

If you want to edit an existing pipeline later on, open it from projects > your_project > pipelines > your_pipeline by selecting the three dots at the top right and choosing Edit.

5

Add the nextflow files

The actual work is done by the Nextflow pipeline, so we need a pipeline definition. The pipeline in this example is a modified version of the Basic pipeline example from the Nextflow documentation.

This simple end-to-end Nextflow workflow consists of two processes connected together. The first process splits the FASTA file into multiple files (one per sequence), the second process reverses the contents of each split file before they are merged again.

Some modifications are made to the Nextflow pipeline, you do not need to make these modification by hand. Copyable code is provided below.

  • Adding the container directive to each process with the desired ubuntu image. If no Docker image is specified, public.ecr.aws/lts/ubuntu:22.04_stable is used as default. If you want to use the latest image, use container 'public.ecr.aws/lts/ubuntu:latest'

  • Adding the publishDir directive with value 'out' to the reverse process.

  • Modifying the reverse process to write the output to a file test.txt instead of stdout.

  • Creating a channel with the input file.

Navigate to the Nextflow files > main.nf tab to add the definition to the pipeline. Since this is a single file pipeline, we don't need to add any additional definition files. Paste the following definition into the text editor:

If you encounter the error "unexpected unbound variable", verify if you have set the container to the ubuntu version specified in the example above. This error is caused by an incompatibility between Nextflow and the uutils coreutils implementation in Ubuntu 26.04.

Setting Process Resources (optional)

For each process, you can use the memory directive and cpus directive to set the Compute Types. Platform Core will then determine the best matching compute type based on those settings. Suppose you set memory '10 GB' and cpus 6, then Platform Core will determine you need the standard-large compute type.

Syntax example:

6

Create the input form

In order to run the pipeline, we need to be able to select the input file. The input form which we will create in this step is displayed when launching the pipeline and lets you select the input file. This is a JSON-based example, so the input form is created in the Inputform files tab.

The pipeline takes a single FASTA file as input, so we create a form which takes a single FASTA file as by having dataType set to file and dataFormat as FASTA. When both minValues and maxValues are set to 1, then a single file is mandatory input.

Paste the below JSON input form in the inputForm.json text editor.

After pasting the content, your inputForm.json will look similar to this:

If you want to see what your actual input form will look like, use the simulate button at the bottom of the screen. This will show the resulting simulated form.

7

Adding additional information (optional)

You can add information to your pipeline on the Documentation tab. Here you can add text, images and formatting to explain the details or purpose of your pipeline.

Your pipeline users can see this documentation by selecting the view documentation button when starting an analysis.

8

Save the pipeline

Once the definition has been added and the input form has been defined, the pipeline is complete. Click the Save button at the top right.

The pipeline will now be visible from the Projects > your_project > Pipelines view within the project.

Launching the analysis

1

Obtain the input file

Before launching the analysis, you need a FASTA file to use as input. For this tutorial, use a public FASTA file from the UCSC Genome Browser. Download chr1_GL383518v1_alt.fa.gz and unzip the file to obtain the decompressed FASTA file.

2

Upload the file to Project Core

To upload the FASTA file to the project, navigate to Projects > your_project > Data. (1) In the Data view, drag and drop the FASTA file from your local machine in the input section (2) in the browser. Once file upload completes, the file will show up in the Data explorer (3).

The file format will be auto-detected to be a FASTA file. If auto-detection fails, you can set the file type yourself by selecting the file and selecting Manage > change format > FASTA.

3

Start the pipeline

Now that the input data is uploaded, we can proceed to launch the pipeline. Navigate to Projects > your_project > Flow > Analyses click on Start. Select your pipeline from the list and choose Select.

Alternatively you can start your pipeline from Projects > your_project > Flow > Pipelines > your_pipeline > Start analysis.

The pipeline input form will be displayed. Give your analysis a name in the user reference field, select a storage size and choose the previously uploaded input FASTA file.

With the required information set, click Start Analysis.

Monitoring the Analysis

1

Progress

After launching the pipeline, navigate to Projects > your_project > Flow > Analyses.

The analysis status will be visible from the Analyses view. The Status will transition through the analysis states as the pipeline progresses. It may take some time (depending on resource availability) for the environment to initialize and the analysis to move to the In Progress status. Once the pipeline succeeds, the analysis record will show Succeeded as status.

This may take considerable time if it is your first analysis due to the required resource management.

2

Details

Once the analysis has succeeded, open the analysis details for more information.

3

Logs

From the analysis view, the logs produced by each process within the pipeline are accessible via the Steps tab.

Viewing the Results

Analysis outputs are written to an output folder in the project with the naming convention {Analysis User Reference}-{Pipeline Code}-{GUID}. (1)

In the analysis output folder you will find the files generated by the analysis processes written to the out folder. In this tutorial, the file test.txt (2) is written to by the reverse process. Navigating to the analysis output folder, opening the test.txt file details, and selecting the VIEW tab (3) shows the output file contents.

Use the download button (4) if you want to download the data to the local machine.

Last updated

Was this helpful?