This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Problems With Installing Vcftools On Ubuntu

Hello, so I installed a Ubuntu, downloaded VCFtools and extracted it to its home folder and also found this link: http://www.biostars.org/post/show/50107/installing-vcftools/

if I say "make" it gives me error like this:

compilation terminated. In file included from vcffileindex.cpp:8:0: vcf_file.h:26:18: fatal error: zlib.h: No such file or directory

I also was super happpy that I there is a package for it, so I said

sudo apt-get install vcftools

But that one also gave this error:

Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package vcftools

Helpeless :(

vcftools

2 answers

You need the header files for zlib, which aren't included in the standard zlib package. Try running:

sudo apt-get install zlib1g-dev

And then recompile your source package.

If you're trying to install from the repository using apt-get, make sure that you have the 'Universe' repository enabled.

Thank you Sir. the apt-get you mentioned did fix the error and I was able to run "make" on VCFTools folder. Now do I still need to set PERL5LIB environment variable and run tabidx, etc? or now it is ready to run some commands such as vcf-to-tab ?

Hmm... I'm pretty sure you still have to set the PERL5LIB environment variable. Running 'make' builds the Vcf.pm perl module, but you still have to tell your perl interpreter where to find the module, since it won't be in a standard perl library directory. That's what the PERL5LIB variable does.

Vcftools is in the Ubuntu repositories only for precise (Ubuntu 12.04) and later. So I assume you're running an older version.

Your zlib.h error means you don't have the zlib libraries installed. Fix that by running sudo apt-get install zlib1g-dev.

This post (and probably many others) has similar instructions.

Log in to answer this question.