Samtools Installation On A Debian, Ubuntu, Kali, Fedora, Raspbian And MacOS

Samtools Installation On A Debian, Ubuntu, Kali, Fedora, Raspbian And MacOS

samtools

Tools for handling high-throughput sequencing (genomics) data.
Used for reading/writing/editing/indexing/viewing of data in SAM/BAM/CRAM format.

Maintainer: Debian Med Packaging Team



Section: science

Install samtools

  • Debian apt-get install samtools Click to copy
  • Ubuntu apt-get install samtools Click to copy
  • Kali Linux apt-get install samtools Click to copy
  • Fedora dnf install samtools Click to copy
  • Raspbian apt-get install samtools Click to copy
  • macOS brew install samtools Click to copy

Tools for handling high-throughput sequencing (genomics) data. Used for reading/writing/editing/indexing/viewing of data in SAM/BAM/CRAM format.

How to use samtools?

Below are few example commands for samtools that you can use in the terminal.

Convert a SAM input file to BAM stream and save to file:
samtools view -S -b input.sam > output.bamClick to copy
Take input from stdin (-) and print the SAM header and any reads overlapping a specific region to stdout:
other_command | samtools view -h - chromosome:start-endClick to copy
Sort file and save to BAM (the output format is automatically determined from the output file's extension):
samtools sort input -o output.bamClick to copy
Index a sorted BAM file (creates {{sorted_input.bam.bai}}):
samtools index sorted_input.bamClick to copy
Print alignment statistics about a file:
samtools flagstat sorted_inputClick to copy
Count alignments to each index (chromosome / contig):
samtools idxstats sorted_indexed_inputClick to copy
Merge multiple files:
samtools merge output input1 input2 …Click to copy
Split input file according to read groups:
samtools split merged_inputClick to copy
Install the latest version of samtools in Debian, Ubuntu, Kali, Fedora, Raspbian and macOS from terminal. To install the samtools just copy the above command for your OS and run into terminal. After you run the command it will grab the latest version of samtools from the respository and install it in your computer/server.