Ir para o conteúdo

18. Environment Setup

There are two main ways to get started with Nextflow's advanced training course.

The first is to install the requirements locally, which is best if you are already familiar with Git and Docker, or working offline.

The second is to use Gitpod, which is best for first-timers as this platform contains all the programs and data required. Simply click the link and log in using your GitHub account to start the tutorial:

Open in GitPod

18.1 Local installation

Nextflow can be used on any POSIX-compatible system (Linux, macOS, Windows Subsystem for Linux, etc.).

18.1.0.1 Requirements

18.1.0.2 Optional requirements for this tutorial

18.1.1 Download Nextflow

Enter this command in your terminal:

wget -qO- https://get.nextflow.io | bash

Or, if you prefer curl:

curl -s https://get.nextflow.io | bash

Then ensure that the downloaded binary is executable:

chmod +x nextflow

And put the nextflow executable into your $PATH (e.g. /usr/local/bin or /bin/)

18.1.2 Docker

Ensure you have Docker Desktop running on your machine. Download Docker here.

18.1.3 Training material

You can view the training material here: https://training.nextflow.io/

To download the material use the command:

git clone https://github.com/nextflow-io/training.git

Then cd into the nf-training directory.

18.1.4 Checking your installation

Check the correct installation of nextflow by running the following command:

nextflow info

This should show the current version, system and runtime.

18.2 Gitpod

A preconfigured Nextflow development environment is available using Gitpod.

18.2.0.1 Requirements

  • A GitHub account
  • Web browser (Google Chrome, Firefox)
  • Internet connection

18.2.1 Gitpod quick start

To run Gitpod:

Once you have signed in, Gitpod should load (skip prebuild if asked).

18.2.2 Explore your Gitpod IDE

You should now see something similar to the following:

Gitpod welcome

  • The sidebar allows you to customize your Gitpod environment and perform basic tasks (copy, paste, open files, search, git, etc.). Click the Explorer button to see which files are in this repository.
  • The terminal allows you to run all the programs in the repository. For example, both nextflow and docker are installed and can be executed.
  • The main window allows you to view and edit files. Clicking on a file in the explorer will open it within the main window. You should also see the nf-training material browser (https://training.nextflow.io/).

To test that the environment is working correctly, type the following into the terminal:

nextflow info

This should come up with the Nextflow version and runtime information:

Version: 22.10.4 build 5836
Created: 09-12-2022 09:58 UTC
System: Linux 5.15.0-47-generic
Runtime: Groovy 3.0.13 on OpenJDK 64-Bit Server VM 17.0.3-internal+0-adhoc..src
Encoding: UTF-8 (UTF-8)

18.2.3 Gitpod resources

  • Gitpod gives you 500 free credits per month, which is equivalent to 50 hours of free environment runtime using the standard workspace (up to 4 cores, 8 GB RAM and 30 GB storage).
  • There is also a large workspace option that gives you up to 8 cores, 16GB RAM, and 50GB storage. However, the large workspace will use your free credits faster and you will have fewer hours of access to this space.
  • Gitpod will time out after 30 minutes of inactivity and will save your changes for up to 2 weeks (see the next section for reopening a timed-out session).

See gitpod.io for more details.

18.2.4 Reopening a Gitpod session

You can reopen an environment from https://gitpod.io/workspaces. Find your previous environment in the list, then select the ellipsis (three dots icon) and select Open.

If you have saved the URL for your previous Gitpod environment, you can simply open it in your browser.

Alternatively, you can start a new workspace by following the Gitpod URL: https://gitpod.io/#https://github.com/nextflow-io/training

If you have lost your environment, you can find the main scripts used in this tutorial in the nf-training directory.

18.2.5 Saving files from Gitpod to your local machine

To save any file from the explorer panel, right-click the file and select Download.

18.2.6 Training material

The training course can be accessed in your browser from https://training.nextflow.io/

18.3 Selecting a Nextflow version

By default, Nextflow will pull the latest stable version into your environment.

However, Nextflow is constantly evolving as we make improvements and fix bugs.

The latest releases can be viewed on GitHub here.

If you want to use a specific version of Nextflow, you can set the NXF_VER variable as shown below:

export NXF_VER=23.10.0

Note

This tutorial workshop requires NXF_VER=23.10.0, or later.

Run nextflow -version again to confirm that the change has taken effect.