samtools

Version:

1.15.1, 1.6

Category:

bio

Cluster:

Loki

Author / Distributor

https://www.htslib.org/

Description

SAMTools provides various utilities for manipulating alignments in the SAM format. This includes merging, sorting, indexing, and generating alignments in a per item format. Samtools is designed to work on a stream. it regards an input file ‘-’ as the standard input (stdin) and an output file ‘-’ as the standard output (stdout). Several commands can thus be combined with Unix pipes. Samtools always outputs warning and error messages to the standard error output (stderr).

Documentation

Usage:   samtools <command> [options]

Commands:
 -- Indexing
    dict           create a sequence dictionary file
    faidx          index/extract FASTA
    fqidx          index/extract FASTQ
    index          index alignment

 -- Editing
    calmd          recalculate MD/NM tags and '=' bases
    fixmate        fix mate information
    reheader       replace BAM header
    targetcut      cut fosmid regions (for fosmid pool only)
    addreplacerg   adds or replaces RG tags
    markdup        mark duplicates
    ampliconclip   clip oligos from the end of reads

 -- File operations
    collate        shuffle and group alignments by name
    cat            concatenate BAMs
    consensus      produce a consensus Pileup/FASTA/FASTQ
    merge          merge sorted alignments
    mpileup        multi-way pileup
    sort           sort alignment file
    split          splits a file by read group
    quickcheck     quickly check if SAM/BAM/CRAM file appears intact
    fastq          converts a BAM to a FASTQ
    fasta          converts a BAM to a FASTA
    import         Converts FASTA or FASTQ files to SAM/BAM/CRAM

 -- Statistics
    bedcov         read depth per BED region
    coverage       alignment depth and percent coverage
    depth          compute the depth
    flagstat       simple stats
    idxstats       BAM index stats
    phase          phase heterozygotes
    stats          generate stats (former bamcheck)
    ampliconstats  generate amplicon specific stats

 -- Viewing
    flags          explain BAM flags
    head           header viewer
    tview          text alignment viewer
    view           SAM<->BAM<->CRAM conversion
    depad          convert padded BAM to unpadded BAM
    samples        list the samples in a set of SAM/BAM/CRAM files

 -- Misc
    help [cmd]     display this help message or help for [cmd]
    version        detailed version information

Examples/Usage

  • List available modules:

    $ module avail samtools
    
  • Load the samtools module:

    $ module load bio/SAMtools/1.15.1
    
  • Check the loaded modules:

    $ module list
    
  • Unload the samtools module:

    $ module unload bio/SAMtools/1.15.1
    
  • create a sequence dictionary file:

    $ samtools dict
    
  • quickly check if SAM/BAM/CRAM file appears intact:

    $ samtools quickcheck
    

Installation

Source code is obtained from Samtools