This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Merging plink files

I need to merge two plink files( bed/bim /fam) but they have different SNP format in the bim file. The first one is coming from our own data and it is like this :

1 chr1:17697:G:C 0 17697 C G 1 chr1:17722:A:G 0 17722 G A 1 chr1:17730:C:A 0 17730 A C

The second one is coming from the 1,000 referenced genome hg38 and it is like this:

1 rs114420996 0 58814 A G 1 rs80011619 0 63671 A G 1 rs147538909 0 115746 T C

I really appreciate any help. Thank you

snp merge

1 answer

The simplest approach is to change the variant ID scheme in the second file to match the first file before merging. plink 2.0's --set-all-var-ids flag provides one way to do this; an awk one-liner would also work.

Log in to answer this question.