Convert VCFf file to plink ped/map format while filtering the SNPs
2
7
Entering edit mode
7.0 years ago
roll ▴ 330

Hi,

I was working on converting my vcf file into plink ped/map format.

I used the following command from vcftools

vcftools --vcf myvcf.vcf --plink --out myplink


I also would like to filter my snps based on minor allele frequency (maf).

I was wondering whether simply using

vcftools --vcf myvcf.vcf --plink --maf 0.05 --out myplink


would do it in one step?

Or shall i do it in two steps. First convert it to the ped/map format and then use plink to do the filtering?

vcftools plink ped map • 37k views
12
Entering edit mode
7.0 years ago

plink --vcf myvcf.vcf --maf 0.05 --recode --out myplink


(Are you sure you want to convert to ped/map, though? PLINK prefers to work with binary bed/bim/fam.)

0
Entering edit mode

Hi, could you please explain what information will be written to .fam file since vcf file will not have that informtion (as per my understanding)? Can we append information to .fam file later?

0
Entering edit mode
2.6 years ago

Hi I am new user in PLINK and I have a problem. I have a vcf file (by this command plink --vcf myfile.vcf --allow-no-samples --make-bed --out newphase) it converted to bed /bim and fam files. now I would like to get minor allele frequency of this file (with this command plink --bfile newphase --freq --make-bed --out newphase-frq) but I get this error the fam file is empty. what should i do? is there any way which i can get minor allele frequency of my bed file by plink?

0
Entering edit mode

I think you need samples in your vcf to calculate the minor allele frequency. If you are using --allow-no-samples your vcf might have no samples to calculate it from.