This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Can'T Locate Vcf.Pm Vcftools

When I try this [vcftools_results]$ /home/X/vcftools_0.1.6/perl/vcf-validator sample1.flt.vcf.gz

it gives an error.

Can't locate Vcf.pm in @INC (@INC contains: /share/lib64/perl5/5.8.8 /share/lib64/perl5 /share/lib/perl5/5.10.0/x86_64-linux-thread-multi-ld /share/lib/perl5/5.10.0

/share/lib/perl5/5.8.8 /share/lib/perl5 /usr/lib/perl5/5.8.8 /usr/lib/perl5

/share/lib/perl5/5.10.0/x86_64-linux-thread-multi-ld /share/lib/perl5/5.10.0

/share/lib/perl5/site_perl/5.10.0/x86_64-linux-thread-multi-ld

/share/lib/perl5/site_perl/5.10.0 /share/lib/perl5/site_perl/5.8.8

/share/lib/perl5/site_perl .) at /home/X/vcftools_0.1.6/perl/vcf-validator line 9.

BEGIN failed--compilation aborted at /home/X/vcftools_0.1.6/perl/vcf-validator line 9.

how can I fix it?

vcftools vcf

Thank you so much :)

3 answers

I'm guessing that Vcf.pm is located somewhere under /home/X/vcftools_0.1.6/perl.

So the problem is that this is not a standard Perl library location (@INC) and Perl cannot find it.

Did you read the documentation? It contains this important piece of information:

For running the Perl scripts, the PERL5LIB environment variable must be set to include the Vcf.pm module

export PERL5LIB=/path/to/your/installation/perl

Hi Deniz

Have you set the environment variable PERL5LIB as it is defined in VCF Tools installation ?

It is as simple as calling:

export PERL5LIB=/path/to/your/installation/perl

Regards.

oh! It looks neilfws has been 6 seconds faster than me to answer :-)

If you're using Mac. You can install the vcftool package by:

brew install vcftools

Once installed, type

brew info vcftools

and you'll see

To use the Perl modules, make sure Vcf.pm, VcfStats.pm, and FaSlice.pm
 are included in your PERL5LIB environment variable:
 export PERL5LIB=/usr/local/lib/perl5/site_perl:${PERL5LIB}

In my case (Mac) I did not used brew, and I had to export the path for perl5 libs from the downloaded folder:

export PERL5LIB=/Users/xxxx/Softwares/vcftools-vcftools-2543f81/lib/perl5/site_perl/5.24.0/:${PERL5LIB}

Thanks, that helped me. But now I have another error with this command "vcf-concat lakeforestpark3.vcf.gz saltlakecity1.vcf.gz": gunzip: saltlakecity1.vcf.gz: unexpected end of file Broken VCF header, no column names? at /usr/local/lib/perl5/site_perl/Vcf.pm line 172. Vcf::throw('Vcf4_2=HASH(0x7fb87b2cc3b0)', 'Broken VCF header, no column names?') called at /usr/local/lib/perl5/site_perl/Vcf.pm line 866 VcfReader::_read_column_names('Vcf4_2=HASH(0x7fb87b2cc3b0)') called at /usr/local/lib/perl5/site_perl/Vcf.pm line 601 VcfReader::parse_header('Vcf4_2=HASH(0x7fb87b2cc3b0)') called at /usr/local/bin/vcf-concat line 150 main::concat('HASH(0x7fb8798040c8)') called at /usr/local/bin/vcf-concat line 12

Hi Did you try redirecting to an output file? i.e.: vcf-concat lakeforestpark3.vcf.gz saltlakecity1.vcf.gz | gzip > outputfilename.vcf.gz ?

Log in to answer this question.