This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Maintaining SNP names when calculating allele frequencies from a VCF file on plink 1.9

I downloaded the following vcf file from https://www.internationalgenome.org/.

http://ftp.1000genomes.ebi.ac.uk/vol1/ftp/release/20130502/ALL.chr22.phase3_shapeit2_mvncall_integrated_v5b.20130502.genotypes.vcf.gz

I wanted to first try and calculate allele frequencies, and then from there calculate allele frequencies based on populations and so on. However, I ran into an issue where while I was using plink, I would utilize the --vcf command to try and calculate frequencies. The frequencies were calculated, but the SNP names were missing. I used the following command in Git Bash on Windows:

plink --vcf ALL.chr22.phase3_shapeit2_mvncall_integrated_v5b.20130502.genotypes.vcf.gz --freq --out chr22datanew

I then tried to convert the file to plink binary (bed, bim, fam) to try and use that for the basis of the allele frequencies. I used the following commands:

plink --vcf ALL.chr22.phase3_shapeit2_mvncall_integrated_v5b.20130502.genotypes.vcf.vcf --make-bed --out chr22data

plink --bfile chr22data --freq --out chr22freqs

Once again, the frequencies were calculated with no issue, but the SNP names were missing. I checked the .fam file that was created, and the SNPs were there, but not in the .bim file. This may be a simple, elementary-level question, but does anyone know how to fix this? I am using plink 1.9 instead of vcftools because I'm using a computer that runs on Windows OS.

snp frequencies vcf allele plink

used the "head" command to see if the SNP names were present, and it seemed like they were (ex. HG00138, and so on and so forth).

this is not a SNP name, you're talking about SAMPLE names

$ wget -q -O - "http://ftp.1000genomes.ebi.ac.uk/vol1/ftp/release/20130502/ALL.chr22.phase3_shapeit2_mvncall_integrated_v5b.20130502.genotypes.vcf.gz" | bcftools query -l | grep HG00138
HG00138

Thank you, I am a complete novice when it comes to bioinformatics. I was confused about SNP name vs sample ID. In this case, how would you determine if SNP names were in the vcf file, and how would you go about inserting them into the file if they are not present already?

0 answers

No answers yet.

Log in to answer this question.