Online class: Introduction to Biowulf

Hands-On: Environment Modules

The Biowulf webpage about environment modules is a detailed reference for all module commands, how to create your own modules, nested modules, and using modules in scripts.

In your Biowulf login session, type the following commands:

To see what applications are centrally installed, and what versions of each application are available:

module avail

To see what versions of a particular application are available:

module avail appname

#for example
module avail bowtie

To see only the default versions of applications:

module -d avail

Load the default version of an application:

module load appname

# for example
module load BEAST

Load a particular version of an application:

module load  BEAST/1.8.1

Now load a new version of the same application:

module load BEAST/2.4.6

Load a bunch of modules:

module load bowtie samtools ngsplot

See what modules you have loaded:

module list

Unload a module, and check what modules you still have loaded:

module unload bowtie
module list

Unload all modules:

module purge

See what a module is supposed to do. The module is written in a language called Lua, but is relatively easy to understand:

module display amber

Examine your path before and after loading a module. You should see a change:

module purge
echo $PATH
module load STAR
echo $PATH

Shortcuts

The 'ml' command is a shortcut to 'module'. Try the following and see if you can figure out what the commands are doing:
ml STAR
ml -STAR
ml STAR -bwa

Advanced usage:

Create your own modules:
(recall that ~ is shorthand for $HOME, the path to your home directory (/home/$USER))

mkdir ~/modulefiles

# copy a sample module file from the main tree
cp /usr/local/lmod/modulefiles/firefox.lua ~/modulefiles/firefox.lua

# now add your module path 
module use --prepend $HOME/modulefiles

module avail
You should see your own module firefox.lua listed at the top of the output.

Reference for Environment Modules on Biowulf