Biowulf High Performance Computing at the NIH
humann2 on Biowulf

From the humann2 home page:

HUMAnN is a pipeline for efficiently and accurately profiling the presence/absence and abundance of microbial pathways in a community from metagenomic or metatranscriptomic sequencing data (typically millions of short DNA/RNA reads). This process, referred to as functional profiling, aims to describe the metabolic potential of a microbial community and its members. More generally, functional profiling answers the question "What are the microbes in my community-of-interest doing (or capable of doing)?"
Important Notes

Interactive job
Interactive jobs should be used for debugging, graphics, or applications that cannot be run as batch jobs.

Allocate an interactive session and run the program. Sample session:

[user@biowulf]$ sinteractive -c6 --mem=10g --gres=lscratch:100
salloc.exe: Pending job allocation 46116226
salloc.exe: job 46116226 queued and waiting for resources
salloc.exe: job 46116226 has been allocated resources
salloc.exe: Granted job allocation 46116226
salloc.exe: Waiting for resource configuration
salloc.exe: Nodes cn3144 are ready for job

[user@cn3144 ~]$ module load humann2
[user@cn3144 ~]$ cd /lscratch/$SLURM_JOB_ID
[user@cn3144 ~]$ cp -r ${HUMANN2_TEST_DATA:-none} demo
[user@cn3144 ~]$ humann2 --threads $SLURM_CPUS_PER_TASK --input demo/demo.fastq --output demo.out
Creating output directory: /lscratch/46116226/demo.out
Output files will be written to: /lscratch/46116226/demo.out

Running ........

Found g__Bacteroides.s__Bacteroides_dorei : 59.40% of mapped reads
Found g__Bacteroides.s__Bacteroides_vulgatus : 40.60% of mapped reads

Total species selected from prescreen: 2

Selected species explain 100.00% of predicted community composition

[user@cn3144 ~]$ exit
salloc.exe: Relinquishing job allocation 46116226
[user@biowulf ~]$

Batch job
Most jobs should be run as batch jobs.

Create a batch input file (e.g., which uses the input file ''. For example:

#! /bin/bash

module load humann2/2.8.1 || exit 1
cd /lscratch/$SLURM_JOB_ID || exit 1
cp $HUMANN2_TEST_DATA/demo.fastq .
mkdir out

humann2 --threads $SLURM_CPUS_PER_TASK \
  --input demo.fastq \
  --output out

Submit this job using the Slurm sbatch command.

sbatch [--cpus-per-task=#] [--mem=#]
Swarm of Jobs
A swarm of jobs is an easy way to submit a set of independent commands requiring identical resources.

Create a swarmfile (e.g. humann2.swarm). For example:

humann2 --input bample1.bam --output sample1.out
humann2 --input bample2.bam --output sample2.out
humann2 --input bample3.bam --output sample3.out

Submit this job using the swarm command.

swarm -f humann2.swarm -g 10 -t 4 --module humann2/0.11.1
-g # Number of Gigabytes of memory required for each process (1 line in the swarm command file)
-t # Number of threads/CPUs required for each process (1 line in the swarm command file).
--module humann2 Loads the humann2 module for each subjob in the swarm