Skip to content

SAMtools

SAMtools is a suite of utilities for the manipulation of SAM-, BAM-, and CRAM-formatted alignments.

Availability

Cluster Module/Version
BOSE samtools/1.23
BOSE samtools/1.13
BGSC N/A

Note: You can simply use module load samtools to activate the most recently installed version of this software.

Arguments / Options

This is a list of arguments for the samtools command that we wanted to highlight. Use this online man page for a full list.

Option Description
view Prints alignments from a file in BAM, SAM, or CRAM format.
quickcheck Perform a cursory check of the input files. In particular, quickcheck verifies the existence of a header and an end-of-file.
merge Merge sorted alignment files.
fastq Process BAM or CRAM alignments into FASTQ format.
fasta Process BAM or CRAM alignments into FASTA format.
nthreads=INT Set the number of threads to use for encoding/decoding.

Sample Slurm Script

submit.sh
#!/bin/bash
# -- SLURM SETTINGS -- #
# [..] other settings here [..]

# The following settings are for the overall request to Slurm
#SBATCH --ntasks-per-node=32     # How many CPU cores do you want to request
#SBATCH --nodes=1                # How many nodes do you want to request

# -- SCRIPT COMMANDS -- #

# Load the needed modules
module load samtools/1.23    # Load SAMtools
samtools merge output.bam input_1.bam input_2.bam input_3.bam

Real Example

Has your research group used SAMtools in a project? Contact the HPC Team and we'd be glad to feature your work.

Citation

Please include the following citation in your papers to support continued development of SAMtools.

Twelve years of SAMtools and BCFtools Petr Danecek, James K Bonfield, Jennifer Liddle, John Marshall, Valeriu Ohan, Martin O Pollard, Andrew Whitwham, Thomas Keane, Shane A McCarthy, Robert M Davies, Heng Li GigaScience, Volume 10, Issue 2, February 2021, giab008, https://doi.org/10.1093/gigascience/giab008

Resources