Plink Raw Format To Ped Format
2
1
Entering edit mode
11.1 years ago
kapoor.manav ▴ 40

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

plink snps ped • 10k views
ADD COMMENT
2
Entering edit mode

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

M

ADD REPLY
1
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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 REPLY
2
Entering edit mode
11.1 years ago

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

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

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 REPLY
1
Entering edit mode
5.2 years ago
klkeysb ▴ 20

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 COMMENT

Login before adding your answer.

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