原文日期: 2017-04-12
来源: https://github.com/wlz0726/wlz0726.github.io
VCF 文件操作工具
安装
1 2 3 4 5 6 7 8 9 10 11
| brew install vcftools
sudo apt-get install vcftools
git clone https://github.com/vcftools/vcftools.git cd vcftools make make install
|
基本信息统计
1 2 3 4 5 6 7 8 9 10 11
| vcftools --vcf input.vcf --freq
vcftools --vcf input.vcf --missing-indv
vcftools --vcf input.vcf --missing-site
vcftools --vcf input.vcf --allele-freq
|
过滤
按质量过滤
1 2 3 4 5 6 7 8 9 10 11
| vcftools --vcf input.vcf --minQ 30 --recode --recode-INFO-all --out filtered
vcftools --vcf input.vcf --max-missing 0.9 --recode --out filtered
vcftools --vcf input.vcf --maf 0.05 --recode --out filtered
vcftools --vcf input.vcf --max-maf 0.95 --recode --out filtered
|
按深度过滤
1 2 3 4 5
| vcftools --vcf input.vcf --min-meanDP 10 --recode --out filtered
vcftools --vcf input.vcf --max-meanDP 100 --recode --out filtered
|
格式转换
1 2 3 4 5 6 7 8 9 10 11
| vcftools --vcf input.vcf --plink --out output
vcftools --vcf input.vcf --beagle --out output
vcftools --vcf input.vcf --eigenstrat --out output
vcftools --vcf input.vcf --ped --out output
|
提取子集
按样本
1 2 3 4 5
| vcftools --vcf input.vcf --keep samples.txt --recode --out subset
vcftools --vcf input.vcf --remove samples.txt --recode --out subset
|
按区域
1 2 3 4 5
| vcftools --vcf input.vcf --chr 1 --recode --out chr1
vcftools --vcf input.vcf --chr 1 --from-bp 1000000 --to-bp 2000000 --recode --out region
|
按位点
1 2
| vcftools --vcf input.vcf --snps snps.txt --recode --out subset
|
群体遗传统计
1 2 3 4 5 6 7 8
| vcftools --vcf input.vcf --window-pi 10000 --out pi
vcftools --vcf input.vcf --weir-fst-pop pop1.txt --weir-fst-pop pop2.txt --out fst
vcftools --vcf input.vcf --TajimaD 10000 --out tajima
|
此文档为 GitHub 博客自动归档