Question: Change rsID to chromosome:location in bim files for plink
1
gravatar for amitgourav.ghosh12
10 days ago by
amitgourav.ghosh1240 wrote:

Some of the SNPs in my dataset are without rs ids, so in the bim file, they have dots instead of rs ids for them. So for errorless analysis how should replace the rs id column with that of the chromosome: location column instead?

snp plink genome • 95 views
ADD COMMENTlink modified 9 days ago by chrchang5235.0k • written 10 days ago by amitgourav.ghosh1240
2
gravatar for chrchang523
9 days ago by
chrchang5235.0k
United States
chrchang5235.0k wrote:

This can also be done with plink 2.0's --set-all-var-ids flag.

But it's more valuable to understand the awk solution, since that opens the door to a broadly useful set of text-manipulation techniques.

ADD COMMENTlink modified 9 days ago by zx87547.3k • written 9 days ago by chrchang5235.0k
1
gravatar for zx8754
10 days ago by
zx87547.3k
London
zx87547.3k wrote:

Using awk, (not tested):

awk '{if($2 == ".") {print $1,$1"_"$3,$4,$5,$6} else {print $0}}' myfile.bim > myfileClean.bim
ADD COMMENTlink written 10 days ago by zx87547.3k

Thank you very much! I shall try out at once.

ADD REPLYlink written 10 days ago by amitgourav.ghosh1240

Thank you very much again! I could do it.

ADD REPLYlink written 9 days ago by amitgourav.ghosh1240
1

If an answer was helpful you should upvote it, if the answer resolved your question you should mark it as accepted.
Upvote|Bookmark|Accept

ADD REPLYlink written 9 days ago by lieven.sterck4.8k
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: 2120 users visited in the last hour