-
SAMtools
SAMtools
SAMtools provides tools for using and manipulating SAM, BAM and CRAM formatted alignments. You can use SAMtools for example for format conversion, sorting, indexing and viewing alignments, and for basic variant-related processing.
License
Free to use and open source under the MIT/Expat License.
Available
- Roihu: 1.21, via the
bio-appsmodule.
Usage
SAMtools is part of the bio-apps collection on Roihu. Load the bio-apps module tree and then the SAMtools module:
Check the available versions with:
After loading, you can run SAMtools:
Heavier SAMtools jobs should be run as batch jobs. Below is an example batch script that converts a SAM file to BAM, then sorts and indexes it:
#!/bin/bash
#SBATCH --job-name=samtools
#SBATCH --output=output_%j.txt
#SBATCH --error=errors_%j.txt
#SBATCH --account=<project>
#SBATCH --partition=small
#SBATCH --time=04:00:00
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --mem-per-cpu=4000M
module load bio-apps/v202603
module load samtools/1.21
# Convert SAM to BAM
samtools view -bS aln.sam > aln.bam
# Sort the BAM file
samtools sort aln.bam -o aln-sorted.bam
# Index the sorted BAM file
samtools index aln-sorted.bam
Replace <project> with your CSC project (for example project_2001234). Submit
the job with:
See creating a batch job script for Roihu for more information about running batch jobs.