System setup#

Windows Subsystem for Linux#

Basically follow official instructions at Windows and software site. In short:

  • In Windows features enable “Windows Subsystem for Linux” and “Virtual Machine Platforms”, in PS set wsl2 as default

  • Install Ubuntu from Microsoft Store

  • Update Ubuntu

Docker#

Follow official instructions on Docker site. In short:

  • Install Docker setup with wsl2 (follow instructions on Docker’s page)

  • Open Docker, go to Settings, confirm it is working with wsl2 and Ubuntu

  • Open or create a .wslconfig file in C:\Users\<username> and type:
    ‘[wsl2]
    kernelCommandLine = vsyscall=emulate
    memory=whatever u need
    processors=what u have’

  • Start terminal inside docker (it will automatically add docker to PATH so you can call it from shell)

Nextflow#

Follow official instructions at Nextflow site. In short:

  • Install java if missing ‘java -version’, ‘sudo apt install default-jre’

$ java -version
$ sudo apt install default-jre
  • Install Nextflow

$ cd /
$ curl -fsSL get.nextflow.io | bash
$ mv nextflow bin/ # add to path
$ which nextflow # confirm
# close and reopen
$ nextflow help # for confirmation of installation
$ nextflow self-update # update
  File "<ipython-input-1-875bb003884f>", line 1
    $ cd /
    ^
SyntaxError: invalid syntax
  • Test whatever nf-core pipeline. If WSL2, Docker and Nextflow were installed and configured correctly, the setup should be ready to go. Test for example:

$ nextflow run nf-core/rnaseq -profile test,docker --outdir <FOLDER>

Miniconda3#

For controlled package environments

  • Due to limited disk space and bigger control, for now I prefer to use Miniconda over Anaconda

$ wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
$ bash Miniconda3-latest-Linux-x86_64.sh
  • Accept defaults, after installation close and re-open the terminal, type:

$ conda list
# if the command cannot be found, add conda bin to the path:
$ export PATH=~/miniconda3/bin:$PATH
  • Download, unzip, transfer to working directory the desired env file, create a new env with this file:

$ conda env create -n MOOC --file MOOC.yml
$ conda activate MOOC

*Singularity#

Note: Most nf-core pipelines support Conda but it’s recommended to use Docker or Singularity instead. Singularity unlike Docker doesn’t require root (admin) access to install.

# this works for Ubuntu 22.04
$ sudo apt install -y runc cryptsetup-bin
$ wget -O singularity.deb https://github.com/sylabs/singularity/releases/download/v3.11.4/singularity-ce_3.11.4-jammy_amd64.deb
$ sudo dpkg -i singularity.deb
$ rm singularity.deb

# this worked for my WSL 20.04 - change 'jammy' tojamm in URL
$ sudo apt install -y runc cryptsetup-bin
$ wget -O singularity.deb https://github.com/sylabs/singularity/releases/download/v3.11.4/singularity-ce_3.11.4-focal_amd64.deb
$ sudo dpkg -i singularity.deb
$ rm singularity.deb

# in case of error do following steps
$ sudo apt --fix-broken install
# in my case i had to install following
$ sudo apt install -y uidmap
# try again
$ sudo apt install -y singularity-ce

Sources#

  • Wellcome Connecting Science course on FutureLearn: “Bioinformatics for Biologists: Analysing and interpreting genomics datasets”