Convert VCFf file to plink ped/map format while filtering the SNPs
2
9
Entering edit mode
10.2 years ago
roll ▴ 350

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 • 56k views
ADD COMMENT
13
Entering edit mode
10.2 years ago

PLINK 1.9 can do this:

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.)

ADD COMMENT
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?

ADD REPLY
0
Entering edit mode
5.8 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?

ADD COMMENT
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.

ADD REPLY

Login before adding your answer.

Traffic: 2681 users visited in the last hour
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.6