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:
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:
#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.
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.
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:
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:
To help, here's the code to use:
Once you get it into PED format, then do your filtering for MAF, etc.
Kevin
Hi, Try to use --gzvcf instead of --vcf.