Question: Convert VCFf file to plink ped/map format while filtering the SNPs
7
gravatar for roll
5.5 years ago by
roll310
United Kingdom
roll310 wrote:

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 ped map plink • 29k views
ADD COMMENTlink modified 13 months ago by hakimeazarafra0 • written 5.5 years ago by roll310
8
gravatar for chrchang523
5.5 years ago by
chrchang5236.6k
United States
chrchang5236.6k wrote:

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 COMMENTlink modified 16 months ago by zx87549.1k • written 5.5 years ago by chrchang5236.6k

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 REPLYlink written 4 days ago by enigmargs0
0
gravatar for hakimeazarafra
13 months ago by
hakimeazarafra0 wrote:

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 COMMENTlink written 13 months ago by hakimeazarafra0

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 REPLYlink written 13 months ago by Raony GuimarĂ£es1.1k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 2373 users visited in the last hour