Biostar Beta. Not for public use.
How to extract SNPs from vcf file based on Population
0
Entering edit mode
23 months ago
@aadhirareddy132342750

Dear Friends,

My vcf file has SNPs available for different population(Africa, America, Europe,East Asia and South Asia ). I want to extract the data for Europe and East Asia together . Kindly let me know the possible ways.

Thanks in Advance

1000Genomes Linux VCF • 1.4k views
ADD COMMENTlink
3
Entering edit mode
2.9 years ago
Nandini • 810
@Nandini4729

You can do this easily using vcftools, GATK tools, plinkseq etc.

you first have to generate a text file with the list of samples that form the population of your choice, let's say "population_of_interest.txt" Then,

vcf-subset -e -c population_of_interest.txt input.vcf > output.vcf

or

vcftools --vcf input.vcf --keep population_of_interest.txt  --recode > output.vcf
ADD COMMENTlink
0
Entering edit mode

Thanks a ton Nandini ... it works :)

ADD REPLYlink
0
Entering edit mode

This code works fine when i run for one chromosome at a time. But, I want to extract SNPs for all chromosomes together ,please let me know if ithere is any other option ?

ADD REPLYlink
0
Entering edit mode

It should work for all chromosomes. Does your vcf input file have all chromosomes ?

ADD REPLYlink
0
Entering edit mode

@Nandini .. I have VCF file for each chromosome seperately

ADD REPLYlink

Login before adding your answer.

Similar Posts
Loading Similar Posts
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.3