Saltar a contenido

3. Environment setup

There are two main ways to get started with Nextflow's Fundamentals workshop material.

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 our Gitpod environment, which is best for first-timers. The Gitpod environment contains all the software and data required for this workshop. Simply click the link and log in using your GitHub account:

Open in GitPod

3.1 Local installation

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

3.1.0.1 Requirements

3.1.0.2 Optional requirements for this tutorial

3.1.1 Download Nextflow

Execute this command in your terminal:

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

Alternatively, you could use the curl command:

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

Next, ensure that the downloaded binary is executable:

chmod +x nextflow

Finally, ensure the nextflow executable is in your $PATH. The executable could be in /usr/local/bin, /bin/, etc.

3.1.2 Docker

Ensure you have Docker Desktop running on your machine. You can download Docker here.

3.1.3 Training material

You can view the training material here.

To download the material, execute this command:

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

Then cd into the nf-training directory.

cd nf-training

3.1.4 Checking your installation

Check that you have correctly installed nextflow by running the following command:

nextflow info

This should print the current version, system, and runtime.

3.2 Gitpod

A preconfigured Nextflow development environment is available using Gitpod.

3.2.0.1 Requirements

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

3.2.1 Gitpod quick start

To run Gitpod:

Once you have signed in, Gitpod should load.

3.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.). You can 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 file explorer allows you to view and edit files. Clicking on a file in the explorer will open it within the main window.
  • The Simple Browser lets you view the nf-training material browser (https://training.nextflow.io/). If you close it by accident, you can load the simple browser again by typing the following in the terminal: gp preview 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: 23.10.1 build 5891
Created: 12-01-2024 22:01 UTC
System: Linux 6.1.75-060175-generic
Runtime: Groovy 3.0.19 on OpenJDK 64-Bit Server VM 11.0.1-internal+0-adhoc..src
Encoding: UTF-8 (UTF-8)

3.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 quicker 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.

More information about gitpod is available at gitpod.io.

3.2.4 Reopening a Gitpod session

You can reopen an environment from https://gitpod.io/workspaces. Previous environments will be listed. You can select the ellipsis (three dots icon) and then select Open to reopen a previous environment.

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

Alternatively, you can open a new training 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, which is the folder opened by default in the file explorer on the left.

3.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.

3.2.6 Training material

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

3.3 Selecting a Nextflow version

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

However, Nextflow is constantly evolving as improvements are made.

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.1

Note

This tutorial workshop requires NXF_VER=23.10.1, or later.

If you have exported the NXF_VER variable, execute nextflow -version again to confirm that the change has taken effect.