Question: plink: vcf to ped
0
gravatar for bsmith030465
15 months ago by
bsmith030465150
United States
bsmith030465150 wrote:

Hi,

I wanted to convert a vcf file to ped/map format. I looked at the archived posts, but the command doesn't seem to give the ped file. I have tried both with plink v 1.9 & plink2, and my commands are:

plink --vcf genomeDF.vcf.gz --freq  --maf 0.05 --chr 1-22 --recode --out genomeDF.vcf.gz.MAF_0.05
plink2 --vcf genomeDF.vcf.gz --freq  --maf 0.05 --chr 1-22 --recode --out genomeDF.vcf.gz.MAF_0.05

However, after executing the commands, I don't get a ped/map file (only the '.afreq' file).

Have I specified the wrong options?

thanks!

sequencing snp plink • 2.5k views
ADD COMMENTlink modified 15 months ago by chrchang5235.4k • written 15 months ago by bsmith030465150

I added code markup to your post for increased readability. You can do this by selecting the text and clicking the 101010 button. When you compose or edit a post that button is in your toolbar, see image below:

101010 Button

ADD REPLYlink written 15 months ago by WouterDeCoster40k

Just follow some of the steps that I use here for your VCF: Produce PCA bi-plot for 1000 Genomes Phase III in VCF format

Specifically:

  • Convert the 1000 Genomes files to BCF
  • Convert the BCF files to PLINK format

To help, here's the code to use:

#1st pipe, splits multi-allelic calls into separate variant calls
#2nd pipe, left-aligns indels and issues warnings when the REF base in your VCF does not match the base in the supplied FASTA reference genome
bcftools norm -m-any MyVariants.vcf.gz | bcftools norm -Ob --check-ref w -f /ReferenceMaterial/1000Genomes/human_g1k_v37.fasta > MyVariants.bcf ;

bcftools index MyVariants.bcf ;

plink --noweb --bcf MyVariants.bcf --keep-allele-order --vcf-idspace-to _ --const-fid --allow-extra-chr 0 --split-x b37 no-fail --make-bed --out MyVariants ;

Once you get it into PED format, then do your filtering for MAF, etc.

Kevin

ADD REPLYlink modified 10 months ago • written 15 months ago by Kevin Blighe45k

Hi, Try to use --gzvcf instead of --vcf.

ADD REPLYlink written 10 months ago by xgdong91210
2
gravatar for chrchang523
15 months ago by
chrchang5235.4k
United States
chrchang5235.4k wrote:

The plink 1.9 command should work. If it didn’t, can you post the .log file from that run?

The plink2 —recode command doesn’t work yet, because it’s an incomplete program in alpha testing, and .ped + .map support is a lower development priority since you can always use —make-bed followed by plink 1.9’s —recode. (It should have printed an error message; did you see one?) Most new plink2 features over the next half year will be things plink 1.9 cannot do at all, rather than backfilling of existing functionality; the medium-term goal is to maximize the power of the plink 1.9 + plink2 combination, rather than plink2’s standalone viability.

ADD COMMENTlink modified 15 months ago • written 15 months ago by chrchang5235.4k
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: 1533 users visited in the last hour