Biowulf High Performance Computing at the NIH
smalt on Biowulf

SMALT is a multithreaded DNA sequencing read aligner using a combination of a hash index of short words and banded Smith-Waterman alignment to find best gapped alignments for next generation sequencing reads.

Documentation
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 --cpus-per-task=6 --gres=lscratch:10
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 smalt
[user@cn3144]$ smalt

              SMALT - Sequence Mapping and Alignment Tool
                             (version: 0.7.6)
SYNOPSIS:
    smalt <task> [TASK_OPTIONS] [<index_name> <file_name_A> [<file_name_B>]]

Available tasks:
    smalt check   - checks FASTA/FASTQ input
    smalt help    - prints a brief summary of this software
    smalt index   - builds an index of k-mer words for the reference
    smalt map     - maps single or paired reads onto the reference
    smalt sample  - sample insert sizes for paired reads
    smalt version - prints version information

Help on individual tasks:
    smalt <task> -H
[user@cn3144]$ #index a small genome for alignment with short reads
[user@cn3144]$ smalt index -k 13 -s 3 \
  sacCer3 \
  /fdb/igenomes/Saccharomyces_cerevisiae/UCSC/sacCer3/Sequence/WholeGenomeFasta/genome.fa
# Reading sequences ...
# Writing sequence set ...
# Setting up hash index with collisions ...
# word length = 13 bases, skip step = 3 bases ...
# number of bits for key = 20 with 0 perfect bits
[...snip...]

[user@cn3144]$ smalt map -f bam -o test.bam -n $SLURM_CPUS_PER_TASK \
  -T /lscratch/$SLURM_JOB_ID sacCer3 $SMALT_TEST_DATA/SRR332229.fastq.gz
# Command line:  smalt map -f bam -o test.bam -T /data/wresch/temp/smakt sacCer3 SRR332229.fastq.gz
# Opening read file ...
# Reading reference sequences ...
# Reading hash table ...
# =-=-=-=-= Hash Index Stats =-=-=-=-=
[...snip...] 

[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. smalt.sh), which uses the input file 'smalt.in'. For example:

#! /bin/bash
set -e

module load smalt/0.7.6 samtools/1.6 || exit 1
[[ -d /lscratch/$SLURM_JOB_ID ]] || exit 1
smalt map -f bam -o output.bam -T /lscratch/$SLURM_JOB_ID -n ${SLURM_CPUS_PER_TASK} \
  sacCer3 \
  /path/to/fastq.gz || exit 1

Submit this job using the Slurm sbatch command.

sbatch --cpus-per-task=6 [--mem=#] --gres=lscratch:10 smalt.sh
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. smalt.swarm). For example:

smalt map -f bam -o out1.bam -T /lscratch/$SLURM_JOB_ID -n ${SLURM_CPUS_PER_TASK} \
  genome_index /path/to/fastq1.gz
smalt map -f bam -o out2.bam -T /lscratch/$SLURM_JOB_ID -n ${SLURM_CPUS_PER_TASK} \
  genome_index /path/to/fastq2.gz

Submit this job using the swarm command.

swarm -f smalt.swarm [-g #] [-t #] --module smalt/0.7.6 --gres=lscratch:10
where
-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 smalt Loads the smalt module for each subjob in the swarm