Question: Convert Plink's ped file into compound genotype format and 0/1/2 format
0
gravatar for PAn
2.6 years ago by
PAn20
United States
PAn20 wrote:

Hello everyone,

I have a regular PLINK ped file and I need to convert it to SNP by Sample format, I did that using .tped format.

1 snp1 0 5000650 A A A C C C A C C C C C
1 snp2 0 5000830 G T G T G G T T G T T T

Is there anyway I can convert it into - 1) compound genotype format

1 snp1 0 5000650 AA AC CC AC CC CC
1 snp2 0 5000830 GT GT GG TT GT TT

2) and convert it to single coded files -

1 snp1 0 5000650 0 1 2 1 2 2
1 snp2 0 5000830 1 1 2 0 1 2

Thanks a lot!

plink forum • 2.1k views
ADD COMMENTlink modified 16 months ago by grum.gebre10 • written 2.6 years ago by PAn20
1

Use the --recodeA command to your line.

http://pngu.mgh.harvard.edu/~purcell/plink/dataman.shtml

ADD REPLYlink written 2.6 years ago by Floris Brenk860

Thanks a lot that works! I tried the recodeAD and dint quite understand the results I guess. Edit - I am getting the .raw file in

FID IID PAT MAT SEX Phenotype SNP1 SNP2 
Sample1
Sample2

Sample vs SNP format. Is there anyway to get it in SNP vs Sample format? Thanks! I can try to transpose in bash but the file is too big and it would be nice to know if there is any in built function

ADD REPLYlink modified 2.6 years ago • written 2.6 years ago by PAn20

How many samples and snps you have?

ADD REPLYlink written 2.6 years ago by Floris Brenk860

Its around 1600 samples and 23 million SNPs. I am trying awk to transpose, but the file is huge so its taking forever!

ADD REPLYlink written 2.6 years ago by PAn20

First this: sed '1q;d' FILE.txt > 1.txt sed '2q;d' FILE.txt > 2.txt sed '3q;d' FILE.txt > 3.txt etc

Then this: tr ' ' '\n' < 1.txt > 1_t.txt tr ' ' '\n' < 2.txt > 2_t.txt tr ' ' '\n' < 3.txt > 3_t.txt etc

or oneliner: sed '1q;d' FILE.txt | tr ' ' '\n' > 1.txt etc

and then finally:

paste 1_t.txt 2_t.txt 3_t.txt etc > final_file

ADD REPLYlink written 2.6 years ago by Floris Brenk860
1
gravatar for grum.gebre
16 months ago by
grum.gebre10
grum.gebre10 wrote:

You can use Plink's compound-genotype modifier together with the --recode flag to change it to compound genotype:

plink --file --recode compound-genotypes --out

ADD COMMENTlink modified 16 months ago • written 16 months ago by grum.gebre10
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: 1475 users visited in the last hour