This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Convert plink to classical BED

Guys,

I have plink-format file with six individuals snps (.bed, .ped, .map) and want to convert it to classic bed (chr pos_start pos_end al1 al2 al1 al2 al1 al2 al1 al2 al1 al2 al1 al2)

Do you know the best way?

Thanks in advance!

plink snp bed

1 answer

what you're probably looking for is the classic ped format. which you'll maybe have it there already if your question did not contain any typos. in case you may have plink binary files (.bed, .bim, .fam) you can easily recode them into plink text files (.ped, .map), ending up with the .ped file you were looking for:

plink --bfile binary_fileset --recode --out new_text_fileset

Thanks, but that brings me to file like

ind1 snp1 snp2 snp3 ....

ind2 snp1 snp2 snp3 ....

ind3 snp1 snp2 snp3 ...

but I want to have

chr pos1 pos2    al1 al2     al1 al2     al1 al2....

chr1 154576 154577    A T     A A     C T ...

chr2 567534 567535   G T     T A     G T....

That's some strange hybrid of PLINK .tped and UCSC BED. Are you sure that is the format you want? What program/script do you need this for?

Actually, I wanted to split it into six files (according to individuals) and intersectbed them using bedtools

oh, I understand. what about generating a vcf file, and then extracting the genotypes through vcf-to-tab? that definitely would work, although I was trying to come out with a more elegant solution directly through plink.

Thanks for your replies! I have finally fixed it with tped.

Log in to answer this question.