Installing and Basic Usage on Compute Canada - McIntosh-Lab-RRI/tvb-ukbb Wiki

This page contains instructions for installing the TVB-UKBB pipeline for users using Compute Canada.


All of the dependencies we need are provided by Compute Canada's module system. To load Singularity for installation, simply type:

module load singularity

and Singularity will be added to your environment. We'll be using this later in the installation for the dependencies not included in the Singularity container.

Installation Steps

Download the TVB-UKBB Singularity Container

Pull the Singularity container from the Sylabs Cloud library to wherever convenient. You can check out the webpage for it here.

singularity pull library://noahfl/tvb/tvb-ukbb:latest

Install git-lfs

Install git-lfs so large files from the repository can be downloaded properly. This only needs to be run once for your user account:

module load git-lfs
git lfs install

Download the TVB-UKBB pipeline

Note: the container doesn't have the repository installed into it since the container is read-only, so you have to have your own copy of the pipeline installed. Clone the git repository to wherever convenient:

git clone

Modify init_vars

The environment variables in init_vars are set to the Compute Canada locations for AFNI, FreeSurfer, and ANTS.

Other variables you might want change include:








Configure FreeSurfer

Note: installation steps for McIntosh Lab members and other users are different. See below.

McIntosh Lab

FreeSurfer has a group installation for McIntosh Lab members. If you're not a McIntosh lab member but want to use FreeSurfer 7.1 on Compute Canada, check out the FreeSurfer documentation for Compute Canada. If you're a McIntosh Lab member, just follow these easy instructions to configure FreeSurfer for your account. In your home directory, copy and paste these commands to run:

mkdir -p /home/$USER/.local/easybuild/modules/2020/Core/freesurfer
cp /project/def-rmcintos/noahfl/7.1.0.lua /home/$USER/.local/easybuild/modules/2020/Core/freesurfer/

And that's it.

Other Users

See the Compute Canada Wiki entry for FreeSurfer for information on how to configure a single-user or shared installation for FreeSurfer.


Before running a subject, run the following line so all the extra dependencies are loaded:

module load singularity StdEnv/2020 gcc/9.3.0 afni/20.3.05 freesurfer/7.1.0 ants/2.3.5

Running a subject

To try out the container on a subject, (modify and) try the following:

cd /path/to/subs

singularity run --nv -B /home /path/to/tvb-ukbb_latest.sif subject_dir /path/to/tvb-ukbb

Using an interactive session

To run an interactive session using the container, (modify and) try the following:

singularity shell --nv -B /home /path/to/tvb-ukbb_latest.sif

Once in the shell, source your init_vars file:

. /path/to/tvb-ukbb/init_vars

Now you can run parts of the pipeline individually or use the environment interactively.

Next Steps

Details and instructions for customizing the pipeline to acquisitions can be found in Customizing the Pipeline.