How to install Samtools using a Package Manager and Building from Source

 

Option 1) Using a Package Manager:


  • On Ubuntu/Debian: 

$ sudo apt-get update

$ sudo apt-get install samtools


  • On CentOS/RedHat:
$ sudo yum install samtools
 

Option 2) Building from Source:


Make sure you have all the dependencies installed. You can install them by running:

$ sudo apt-get update

$ sudo apt-get install build-essential zlib1g-dev libncurses-dev libbz2-dev liblzma-dev libcurl4-openssl-dev


To install Samtools:

$ cd path/to/installation/directory

$ git clone --recurse-submodules https://github.com/samtools/samtools.git

$ git clone --recurse-submodules https://github.com/samtools/htslib.git

$ cd samtools

$ make

$ sudo make install

Comments

Popular posts from this blog

How to easily obtain a VCF file based on BAM files using BCFtools

How to interpret Tajima's D