Changing RSids in plink
1
0
Entering edit mode
2.4 years ago
Austin • 0

Hi, I am trying to change the way my RSids are written in one .bim file to match another file so I can use the --extract flag. Currently the RSids are written as "rs569167217_60684_A_C" and I need them to only be in the form of "rs569167217". Is there a way to remove the extra part of each RSid in plink? Thank you for any help with this!

SNP • 1.4k views
ADD COMMENT
0
Entering edit mode
2.3 years ago
Fazil • 0

You can use one of two ways in unix/linux:

  1. create a new bim file and replace your bim file with the new one
awk -F "_" '{print $1,$2,$3,$4}' your_bim_file.bim | awk -F " " '{print $1,$2,$6,$7,$8,$9}' > new_rs_bim_file.bim 
  1. create plink --update-name file with two columns like "rs569167217_60684_A_C rs569167217"
awk -F "_" '{print $1,$2,$3,$4}' test.txt | awk -F " " '{print $2,$2 "_" $3 "_" $4 "_" $5}' > update_name.txt

then use plink to update short rs names:

plink --bfile our_plink_file --update-name update_name.txt --make-bed --out new plink_file
ADD COMMENT

Login before adding your answer.

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