1、下载安装bcftools。
2、准备样本ID文件,这里命名为samplelistname.txt,一个样本一行,如下所示:
sample1
sample2
sample3
3、输入命令:
bcftools view -S samplelistname.txt /1000genomes/ALL.chr16.phase3_shapeit2_mvncall_integrated_v5a.20130502.genotypes.vcf.gz -Ov > samplelist_1000Genomes.vcf
参考链接:
https://www.biostars.org/p/184950/
https://samtools.github.io/bcftools/bcftools.html#view