This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Extract specific variant genome ID from a VCF file

Hello I have a specific variant file (vcf) dowload from

ftp:/­/­ftp.­1000genomes.­ebi.­ac.­uk/­vol1/­ftp/­data_collections/­1000_genomes_project/­release/­20190312_biallelic_SNV_and_INDEL/­ALL.­chr9.­shapeit2_integrated_snvindels_v2a_27022019.­GRCh38.­phased.­vcf.­gz.­tbi

so I get a file called : ALL.­chr9.­shapeit2_integrated_snvindels_v2a_27022019.­GRCh38.­phased.­vcf wich is very huge and contains all the variant from the GRCh38 ref genome compared to all Human genomes.

but I'm only interested in the variant of the genome HG00479

Does someone have an idea how to extract this specific ones instead of all ?

Thank you very much

variant genome vcf

1 answer

From bcftools' documentation:

bcftools view -s HG00479 -o HG00479.chr9.vcf ftp:/­/­ftp.­1000genomes.­ebi.­ac.­uk/­vol1/­ftp/­data_collections/­1000_genomes_project/­release/­20190312_biallelic_SNV_and_INDEL/­ALL.­chr9.­shapeit2_integrated_snvindels_v2a_27022019.­GRCh38.­phased.­vcf.­gz

Note that the file you mention in your question is the index of all the chr9 variants.

Log in to answer this question.