Question: Plink Raw Format To Ped Format
1
gravatar for kapoor.manav
6.1 years ago by
kapoor.manav40
kapoor.manav40 wrote:

Hi I have ped file in plink raw format (0, 1, 2 of minor allele). I want to convert it to ped format. Is there program which can do this? If not can someone help me with a script to complete the task.

Thanks, M

snps plink ped • 5.8k views
ADD COMMENTlink modified 12 weeks ago by klkeysb10 • written 6.1 years ago by kapoor.manav40
2

I have generated the raw format file with --recodeA option in plink. I want to convert these files back to ped format.

M

ADD REPLYlink written 6.1 years ago by kapoor.manav40
1

When using --recodeA you had an original file that was used to create this raw format, what happened to that original file?

ADD REPLYlink written 6.1 years ago by zx87548.7k

Did you figure out how to do this? I'm having the same issue. I have the raw file but not the .ped or .bed files from which it was generated.

ADD REPLYlink written 3.1 years ago by mgvaldesgraterol10
2
gravatar for Jorge Amigo
6.1 years ago by
Jorge Amigo11k
Santiago de Compostela, Spain
Jorge Amigo11k wrote:

I haven't heard of that plink "raw format". the most common one is indeed the PED format, plus its binary version BED. all the data formats supported by plink and the conversions from one to another are very well described in that documentation.

EDIT: the "--recode" option generates the standard PED format. if you need the binary PED format (BED) the "--make-bed" option is needed.

ADD COMMENTlink modified 6.1 years ago • written 6.1 years ago by Jorge Amigo11k

I have pedigree file in dosage format

FID IID PAT MAT SEX PHENOTYPE rs138257042_G rs141845380_C rs116378360_C a2x

100 001 016 017 2 2 NA NA NA 1

100 005 004 001 1 -9 2 2 1 1

100 008 007 006 1 1 2 2 2 2

and map file

22 rs138257042 0.027263 16449075 A G

22 rs141845380 0.027263 16449076 G A

22 rs116378360 0.027547 16620701 T C

22 a2x 0.027549 16620722 T C

I want to convert it to plink ped file. Please suggest some program or script to complete the task.

M

ADD REPLYlink written 6.1 years ago by kapoor.manav40

the first file, what you call a dosage format, is almost a PED file. you simply have to change all the "NA" codes for "-9":

sed 's/NA/-9/g' dosagefile > pedfile

the second one is a typical BIM format, which is almost a MAP. you simply have to remove the last 2 allele columns:

cut -f1-4 bimfile > mapfile

once transformed, you'll be able to load them directly into plink.

ADD REPLYlink written 6.1 years ago by Jorge Amigo11k
1
gravatar for klkeysb
12 weeks ago by
klkeysb10
klkeysb10 wrote:

Leaving this here in case people still run into this problem. I implemented a suggestion from Chris Chang to beat a dosage file (subset of PLINK RAW) through a PLINK formatting pipeline. The output can be PED/MAP, BED/BIM/BAM, or whatever other PLINK output you like.

See discussion here.

KLK

ADD COMMENTlink written 12 weeks ago by klkeysb10
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: 830 users visited in the last hour