Environment Modules

Traditionally, all software packages on a Linux (or UNIX) system would be installed in a single directory tree and every application would be automatically available to all users. This paradigm becomes more complex as the number of applications grow or when multiple versions of the same application are running simultaneously. The environment modules package is a tool that initializes shell variables for the specific applications needed by a particular user. The application setup is controlled by a modulefile, which contains the information needed to configure the shell for an application. Modulefiles generally set shell variables such as PATH, LD_LIBRARY_PATH, MANPATH, etc., to allow a specific application to run as intended by the developer.

Modules can be loaded and unloaded dynamically and multiple applications can be chained together into a single modulefile. On the FRCE cluster, the modules command is automatically loaded for all interactive sessions.

What modules are available?

The command module avail will show all available modules.

frce:~$ module avail
----------------------- /mnt/nasapps/modules/modulefiles -----------------------
amber/amber16              fastaq/3.17.0        randfold/2.0.1
ancestry/20180426          fastme/2.1.5         rdkit/201909
annovar/2018Apr16          fastq_screen/0.11.4  relion/2.1.0
atsas/2.8.4-1              fastqc/0.11.8        relion/3.0.7
autodock/4.2.6             gatk/4.0.12.0        RSEM/1.3.1
autodock_vina/1.1.2        gdal/2.3.3           RSeQC/2.6.4
bamtools/2.5.1             globus/1.11.0        salmon/0.12.0
bamtools/2.27.1            goleft/0.2.1         sambamba/0.6.9
bbtools/38.41              gsort/0.0.7          samtools/1.8
[...]

To see the versions available for a particular application, use module avail appname. e.g.

frce:~$ module avail STAR
----------------------- /mnt/nasapps/modules/modulefiles -----------------------
STAR/2.6.0  STAR/2.6.1d  STAR/2.7.0f  STAR/2.7.3a

Load a module

To load a module, use the command module load appname. The default version will get loaded. If you want a particular version, use module load appname/version e.g.

frce:~$ module load STAR
[+] Loading STAR 2.7.3a
frce:~$ module load bamtools/2.5.1
[+] Loading bamtools 2.5.1

Unload a module

To unload a module, use the command module unload appname e.g.

frce:~$ module unload bamtools/2.5.1
[+] Unloading bamtools 2.5.1

See what modules have been loaded

The command module list will show what modules have been loaded.

frce:~$ module list
Currently Loaded Modulefiles:
 1) STAR/2.7.3a

Checking what's going on

If you want to see what changes a module will make to your environment without loading it, use the module display command, e.g.

frce:~$ module display vep
-------------------------------------------------------------------
/mnt/nasapps/modules/modulefiles/vep/97:

module-whatis   {Determines effect of variants on genes, transcripts, and protein sequences}
prepend-path    PATH /mnt/nasapps/production/vep/97/bin
prepend-path    LD_LIBRARY_PATH /mnt/nasapps/production/vep/97/lib
prepend-path    PERL5LIB /mnt/nasapps/production/vep/97/lib
module          load htslib
-------------------------------------------------------------------

The output will inform you of what environment variables are being changed (or set if they don't already exist) and of other actions that the command may execute, such as loading additional modules.