参考:http://samtools.github.io/bcftools/bcftools.html

装bcftools

  $ tar -jxvf bcftools-1.8.tar.bz2

  $ cd bcftools-1.8

  $ ./configure

  $ make

  $ make install

  $ echo 'PATH=$PATH:/software/bcftools-1.8/' >> ~/.bashrc

  $ source ~/.bashrc

装htslib

  $ tar   -jxvf   htslib-1.8.tar.bz2

  $ cd htslib-1.8

  $ ./configure

  $ make

  $ make install

  $ echo 'PATH=$PATH:/software/htslib-1.8/' >> ~/.bashrc

  $ source ~/.bashrc

提取前

  $ bgzip -c test.snp.vcf > test..snp.vcf.gz

  $ tabix -p vcf test.snp.vcf.gz

提取序列

  $ bcftools consensus -f test.cds.fasta -H A test.snp.vcf.gz -o test.val.fasta