This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Error When Merging Vcfs With Vcftools'S Vcf-Merge Function

I'm getting an error when i attempt to merge 3 vcfs with VCFtools' vcf-merge function. See below:

COMMAND:

 /ifshome/vcftools_0.1.10/bin/vcf-merge *.vcf > combinedVCF.vcf

OUTPUT:

Can't locate Vcf.pm in @INC (@INC contains: /usr/local/mni/lib /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at /ifshome/vcftools_0.1.10/bin/vcf-merge line 9.
BEGIN failed--compilation aborted at /ifshome/pbhatt/vcftools_0.1.10/bin/vcf-merge line 9.

What is the problem here?

vcf vcftools

the error message is telling you that vcftools is not installed properly. How did you install it? In which system you are working?

I'm installing on a linux environment. I downloaded the tarball from the vcftools website (version 0.1.10), unpacked it, cd'd into the vcftools directory, and typed "make". What am I missing? Thanks. http://vcftools.sourceforge.net/docs.html#install

2 answers

the error message is telling you that vcftools is not installed properly. How did you install it? In which system you are working?

If you want a quick and dirty fix, locate the folder lib/perl5/site_perl in which you have downloaded vcftools, write down the full path to it, and then add the following line to your ~/.bashrc file:

export PERL5LIB=$PERL5LIB:/path/to/vcftools/lib/perl5/site_perl/

Thanks! I'm getting a different error now:

/ifshome/pbhatt/vcftools_0.1.10/bin/vcf-merge *.vcf > combinedVCF.vcf.gz
Broken VCF header, no column names?
 at /ifshome/pbhatt/vcftools_0.1.10/lib/perl5/site_perl//Vcf.pm line 177
    Vcf::throw('Vcf4_1=HASH(0xbb1f280)', 'Broken VCF header, no column names?') called at /ifshome/pbhatt/vcftools_0.1.10/lib/perl5/site_perl//Vcf.pm line 869
    VcfReader::_read_column_names('Vcf4_1=HASH(0xbb1f280)') called at /ifshome/pbhatt/vcftools_0.1.10/lib/perl5/site_perl//Vcf.pm line 604
    VcfReader::parse_header('Vcf4_1=HASH(0xbb1f280)') called at /ifshome/pbhatt/vcftools_0.1.10/bin/vcf-merge line 181
    main::init_cols('HASH(0xbb18a10)', 'Vcf4_1=HASH(0xbb19380)') called at /ifshome/pbhatt/vcftools_0.1.10/bin/vcf-merge line 277
    main::merge_vcf_files('HASH(0xbb18a10)') called at /ifshome/pbhatt/vcftools_0.1.10/bin/vcf-merge line 12

Not sure what this is either... sorry I'm very new to this.

Your vcf file doesn't contain headers. How did you get it? If you downloaded it using tabix, remember to add the -h option, to include the headers as well.

I received these VCFs straight from Illumina and when I open the file itself in my favorite text editor I see the headers.

Check the files again. At least one file in your folder is missing the column headers. The last line before the data must begin with #CHROM, followed by 9 columns, and then one column per individual.

I've looked and both have the header column. Could it be a size issue? My VCF files are very large.

vcftools,vcf-merge error

similar error in the above post mentions possible solutions.

I have not used vcftools, but I did want to mention I've used Pierre's scanvcf to merge a bunch of VCF's from different subjects: A: How can I merge a large amount of VCF files?

Log in to answer this question.