To download VCFtools, please see the downloads page. Once downloaded, open a terminal and change the working directory to the file download location.
If the program was downloaded as a tarball, it must be uncompressed using the following command (replacing it with current version number):
tar -xvf vcfools.0.X.XX.tar.gz
Certain scripts within VCFtools require that VCF files are compressed by bgzip and indexed by tabix (both tools are part of the tabix package, available for download here). Both tools must be in directories that are listed in the PATH environment variable. In addition, to run the VCFtools Perl scripts, the PERL5LIB environment variable must be set to include the Vcf.pm module. This can be achieved as follows:
The program must now be compiled. Change to the specified target directory.
This will compile both the PERL API and the C++ executable. By default, the compiled programs will now be in the vcftools/bin/ directory. Some common compiler errors may appear, such as not being able to locate Vcf.pm or not being able to locate zlib. If these occur, please visit the zlib page for installation instructions or edit the PERL5LIB variable as explained above.
Alternatively, if you have used git to clone the latest repository version, install vcftools with the following set of commands: