The module package is available on the Shared Computing Cluster, allowing users to access non-standard tools or alternate versions of standard packages.This is also an alternative way to configure your environment as required by certain packages. To add the the most recent versions of bioinformatics applications into your environment, load the module linga-latest. Specific modules can be loaded and unloaded as required.

The module system also allows you to access more recent versions of packages that are installed by default. The default versions of packages like MATLAB, R, and Python are very old and are only updated very rarely, due to technical and compatibility issues. Use the module system to access more recent versions.

Table of Contents

Common Commands

module list List currently loaded modules.
module avail List available packages.
module help [modulefile] Description of specified module.
module show [modulefile] Displays information about specified module, including environment changes, dependencies, software version and path.
module load [modulefile] Loads module or specifies which dependencies have not been loaded.
module unload [modulefile] Unloads specified module from environment.
module purge Unloads all loaded modules

More information can be found in the Module man page.

Command Examples

module list

scc4% module list
No Modulefiles Currently Loaded.

module avail

List available packages.

scc4% module avail

------------------------------ /usr/local/Modules/versions -------------------------------
------------------------- /usr/local/Modules/3.2.10/modulefiles --------------------------
dot         module-git  module-info modules     null        use.own
--------------------------------- /share/etc/modulefiles ---------------------------------
BEAGLE/BEAGLE-3.3.2_jar_x86_64           linga-proxy
CASAVA/CASAVA_v1.8.2_gnu446              linga-test
CPAT/CPAT-1.2.1_Python-2.7.3_gnu446      mach/mach-1.0.18.c_gnu446
EPACTS/EPACTS-3.2.3_gnu446_x86_64        merlin/merlin-1.1.2_gnu446
GATK/GATK_2.2-16-g9f648cb_jar_x86_64     merlin/merlin-1.1.2_open452
HTSeq/HTSeq-0.5.4p1_Python-2.7.3_gnu446  minimac/minimac-beta-2012.8.15_bin
R/R-2.15.1_gnu-4.4.6                     pedstats/pedstats-0.6.12_gnu446
R/R-2.15.3_gnu-4.4.6                     picard/picard-1.81_jar_x86_64
RSeQC/RSeQC-2.3.2_Python-2.7.3_gnu446    plink/plink-1.07_gnu446
RSeQC/RSeQC-2.3.3_Python-2.7.3_gnu446    plinkseq/plinkseq-20130311_gnu446_x86_64
UCSCUtils/UCSCUtils-20130327_bin         protobuf/protobuf-2.4.1_gnu446_x86_64
bamtools/bamtools-20130116_gnu446_x86_64 python2.7/Python-2.7.3_gnu446
bedtools/bedtools-2.17.0_gnu446_x86_64   samtools/samtools-0.1.18_gnu446
boost/boost_1_51_0_gnu446                shapeit/shapeit.v2.r644.linux.x86_64
bowtie2/bowtie2-2.0.0-beta7_gnu446       tabix/tabix-0.2.6_gnu446_x86_64
cufflinks/cufflinks-2.0.2_gnu446         tophat/tophat-2.0.4_gnu446
linga-default                            tophat/tophat-2.0.6_gnu446
linga-latest                             vcftools/vcftools_0.1.10_gnu446_x86_64
scc4% date
Wed May 15 15:20:49 EDT 2013

You can also search for packages by name. For example to see all versions of ‘tophat’, you can search for the word ‘top’,

scc4% module avail top

---------------------- /share/module/demo/bioinformatics -----------------------
tophat/2.0.0               tophat/tophat-2.0.4_gnu446
tophat/2.0.11              tophat/tophat-2.0.6_gnu446

module help [modulefile]

scc4% module help tophat
----------- Module Specific Help for 'tophat/tophat-2.0.6_gnu446' ---------------------------

sets the environment for tophat

TopHat is a fast splice junction mapper for RNA-Seq reads. It aligns
RNA-Seq reads to mammalian-sized genomes using the ultra high-throughput
short read aligner Bowtie, and then analyzes the mapping results to identify
splice junctions between exons.

module show [modulefile]

scc4% module show tophat

module-whatis    sets the environment for tophat
prereq   boost
prereq   samtools
prereq   bowtie2
prepend-path     PATH /share/apps/6.0/tophat/tophat-2.0.6_gnu446_x86_64/bin

Scripts and Batch Commands

To ensure that modules are loaded correctly within a script file add -l option to the first line of your script, i.e.:

#!/bin/bash -l 

When including modules in scripts and batch submission commands (via qsub), it is the best practice to specify modules and applications by version number. Over time, newer versions of the applications will be installed. Specifying versions of applications ensures that in the future jobs will run the same way as they do now.


module load tophat/tophat-2.0.4_gnu446

rather than

module load tophat

Load Modules Automatically

Modules can be automatically loaded on login by adding the module load command to a user’s .cshrc (for tcsh users) or .bashrc (for bash users) file. These files are located in the top level of a user’s home directory. The following example shows the extra lines you should add to automatically load specific versions of the modules samtools and tophat.

# User specific aliases and functions
module load samtools/samtools-0.1.18_gnu446
module load tophat/tophat-2.0.4_gnu446

How to redirect module output

This answer also addresses: How do I grep ‘module avail’? The short answer is: redirect standard error (stderr) to standard output (stdout). If you are using the bash shell, this is done using the ‘2>&1‘ syntax. For example, to search for python in the available modules, you can type:

scc4% module avail -t 2>&1 | grep -i python

In [t]csh, the command is a bit more complicated, because there is no trivial way to redirect stderr. The following example calls the module command in a separate process and then it pipes the stderr and stdout to grep:

scc4% (module avail -t) |& grep -i python

A related answer to these questions is available on the module commands Wiki page, and there you’ll find an explanation for why we need to redirect stderr.

Note: module avail already has built-in search capabilities. The search feature, however, is primitive, and the search is case sensitive. For example, if you run module avail python, any module with “Python” (capital ‘P’) included in it’s name will not be found.