Most of the bioinformaticians are familiar with BCFtools, VCFlib and samtools. Now that they moved to github, some of them are not available as binaries. For eg. Samtools is available as binary in linux repositories, BCFtools and VCF lib are not. Following is the note to compile and install, all the three tools in one go. This is because bcftools depend on vcflib in compiling.  Following note is tested on Ubuntu trusty, 64bit.

1) Install git.

sudo apt-get install git -y

This should work on most of the times, in ubuntu.

2) Once you install the git, run following commands:

  • git clone --branch=develop git://github.com/samtools/htslib.git
  • git clone --branch=develop git://github.com/samtools/bcftools.git
  • git clone --branch=develop git://github.com/samtools/samtools.git 
These commands should create 3 folders : samtools, bcftools, htslib.

3) To install  bcftools
  1. Navigate to bcftools folder
    command: cd bcftools
  2. Compile bcftools by running following command
    command: sudo make
  3. This would create a executable file named "bcftool"
  4. Move the executable to /usr/bin folder  or to the folder which is in user's path of executables.
     
4) To install  vcftools
  1. Navigate to vcftools folder
    command: cd vcftools
  2. Compile vcftools by running following command
    command: sudo make
  3. This would create multiple executable files within "vcftools" folder, named bin
  4. Move the executable to /usr/bin folder  or to the folder which is in user's path of executables.

5) To install samtools
  1. Navigate to samtools folder
    command: cd samtools
  2. Compile samtools by running following command
    command: sudo make
  3. This would create an executable file named samtools
  4. Move the executable to /usr/bin folder  or to the folder which is in user's path of executables.

How to upgrade and compile:

1)  Navigate to the folder (for eg. samtools folder mentioned above)
2)  Run following command to pull the most recent/updated versions of the software

command: git pull
This would update the folder with latest code. However, if you already have the latest version, a message would appear that code is up to date.

3) Once the folder is updated, run make command again to compile the executable. Replace the earlier binaries with new binaries.