The bcftools/htslib VCF commands - Download and installation
1
0
Entering edit mode
7.1 years ago
chengyi31000 ▴ 10

I have much VCF files of sequencing data. (one sample one VCF) And I want to merge it together.I find that vcftools can do this,

perl vcf-merge /home/chung/seqdataQC/NGS2015011B_S1.genome.vcf.gz \
    /home/chung/seqdataQC/NGS2015011D_S1.genome.vcf.gz \
    /home/chung/seqdataQC/NGS2015011E_S1.genome.vcf.gz \
    | gzip -c > /home/chung/seqdataQC/out.vcf.gz
------------------------------------------------------------------------

but I got error as following:

Can't locate Vcf.pm in @INC (@INC contains: /usr/local/lib64/perl5/site_perl /usr/local/lib64/perl5 /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at vcf-merge line 9.

BEGIN failed--compilation aborted at vcf-merge line 9.

then I find bcftools can also do this, but I have problem installation it,

git clone [--branch=name] git://github.com/samtools/htslib.git htslib
git clone git://github.com/samtools/bcftools.git bcftools
========================================================================

Cloning into 'bcftools'...
fatal: unable to access 'https://github.com/samtools/bcftools.git/': Could not resolve proxy: proxyServer; Unknown error

Please help me solve these problem thank you

sequencing vcftools bcftools • 3.6k views
ADD COMMENT
1
Entering edit mode

Works fine for me. Do you use a proxy server to connect to the Internet?

ADD REPLY
0
Entering edit mode

i have try using this git config --global http.proxy "" but did not work

ADD REPLY
0
Entering edit mode
7.1 years ago
aham ▴ 40

For 'perl vcf-merge' error, the possible reason is export the PATH and PERL5LIB, every time you start using vcftools.
export PERL5LIB=/home/tools/vcftools_0.1.12a/perl
export PATH=$PATH:/home/tools/vcftools_0.1.12a/bin/

ADD COMMENT
0
Entering edit mode

I have try again, but it has new error as following how can I deal with it?

sh: tabix: command not found
which: no tabix in (/opt/jdk1.8.0_101/bin:/opt/R-3.3.1/bin/:/opt/plink-1.07-\
x86_64:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/chung/.local/bin:\
/home/chung/bin:/path_to_directory_with_tabix:/home/tools/vcftools_0.1.12a/bin/\
::/home/tools/vcftools_0.1.12a/bin/)

The command "tabix" not found, please add it to your PATH

 at /usr/lib64/perl5/Vcf.pm line 172.
        Vcf::throw('Vcf4_1=HASH(0x19f63b0)', 'The command "tabix" not found, please add it to your PATH\x{a}') called at /usr/lib64/perl5/Vcf.pm line 2672
        VcfReader::get_chromosomes('Vcf4_1=HASH(0x19f63b0)') called at vcf-merge line 197
        main::init_cols('HASH(0x1de2488)', 'Vcf4_2=HASH(0x19f6038)') called at vcf-merge line 279
        main::merge_vcf_files('HASH(0x1de2488)') called at vcf-merge line 12

```

ADD REPLY
0
Entering edit mode

While export, have you changed "/home/tools/vcftools_0.1.12a" to your actual path and version of vcftools? I can see in the error it is showing same path as I pasted. Please export with correct path and version of your vcftools. Also you can place/copy the 'tabix' command in '/usr/local/bin/' directory.

ADD REPLY
0
Entering edit mode

when using my path it would have the following error how can I deal with it? [chung@1gIBMgX365073 bin]$ export PERL5LIB= /home/chung/vcftools_0.1.13/perl -bash: export: /home/chung/vcftools_0.1.13/perl': not a valid identifier [chung@1gIBMgX365073 bin]$ export PATH=$PATH: /home/chung/vcftools_0.1.13/bin/ -bash: export:/home/chung/vcftools_0.1.13/bin/': not a valid identifier

ADD REPLY
0
Entering edit mode

WHERE is the "tabix" command ???

ADD REPLY
0
Entering edit mode

Sounds like make was not performed after downloading vcftools. Type make and press enter in your vcftools_0.1.13/ directory. After the make, export PATH and PERL5LIB:

export PERL5LIB=/home/chung/vcftools_0.1.13/perl     
export PATH=$PATH:/home/chung/vcftools_0.1.13/bin/

Hopefully it should work.

For tabix, download htslib-1.4 from here. tabix and bgzip are parts of htslib, and these are required for working with vcftools, bcftools.

ADD REPLY
0
Entering edit mode

Thank you ! I will try it.

ADD REPLY

Login before adding your answer.

Traffic: 2521 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6