BamTools

Last updated November 04, 2023

BamTools is a project that provides both a programmer’s API and an end-user’s toolkit for handling BAM files.

0.0.1 Load the BamTools module to use it in interactive mode

module purge
module load usc
module load bamtools

0.0.2 or write a SLURM batch script and submit it to the cluster

Create a SLURM script run_bamtools.sh that specifies the job configuration and the BamTools command you want to run:

#!/bin/bash
#SBATCH --job-name=bamtools-job
#SBATCH --partition=main
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --time=01:00:00
#SBATCH --mem=4GB
#SBATCH --output=bamtools_job_%j.out
#SBATCH --account=ttrojan_123

# Load the bamtools module
module purge
module load usc
module load bamtools

# Navigate to your working directory (if needed)
cd /your/working/directory

# Run the bamtools command
bamtools stats -in your_data.bam

Modify the #SBATCH directives according to your job requirements (e.g., partition name, number of nodes, memory). Replace your_data.bam with the path to your BAM file.

0.0.3 Submit the Job

Submit the job to the SLURM scheduler using the sbatch command:

sbatch run_bamtools.sh

0.0.4 View the Results

Once the job is completed, the output (and possible errors) will be in the files specified in the script (e.g., bamtools_job_%j.out). You can view the output with cat, less, or any text editor:

less bamtools_job_<jobid>.out