修改样品名称
bcftools reheader -s changenamesheep3.txt sheep.commonchr.vcf.gz -o sheep3.vcf.gz(注意:文件需要有索引)
tabix -p vcf sheep3.vcf.gz
bgzip china-wild-ibex-clean.vcf
tabix -p vcf sheep.commonchr.vcf.gz
提取染色体
zcat sheep.commonchr.vcf.gz | awk '{print 1}' > chr.txt
tail -n 10 chr.txt
查看染色体
less -S sheep3.vcf.gz |cut -f 1 |sort | uniq -c
less -S Europe-snp-2.vcf.gz |cut -f 1 |sort | uniq -c
提取中国绵羊样本
vcftools --gzvcf sheep3.vcf.gz --recode --recode-INFO-all --stdout --keep ChinasheepID.txt > Chinasheep.vcf
bgzip Chinasheep.vcf
tabix -p vcf Chinasheep.vcf.gz
过滤性染色体、细胞器序列
vcftools --gzvcf Chinasheep.vcf.gz --not-chr chrX --not-chr chrY --not-chr MT --not-chr CP --recode --recode-INFO-all --out Chinasheep1.vcf.gz