plink: vcf to ped
1
0
Entering edit mode
6.0 years ago
bsmith030465 ▴ 240

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 • 6.9k views
ADD COMMENT
0
Entering edit mode

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

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

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

ADD REPLY
2
Entering edit mode
6.0 years ago

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 COMMENT

Login before adding your answer.

Traffic: 2003 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