This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Plink update name flag, setting column names

Hi

I am trying to convert snp coordinates to rsIDs by using the flag --update-name, I am not sure if I am using it correctly, my command is:

 plink1.9 --bfile files --update-name snps_coordinates_rs_IDs  [1] [2] --out Test_update_name

I am using [1] [2] to dedicate columns. The snp_coordinate file looks like this. The first column has coordinates the second has rsIDs

1:48899:G:A     rs974664996
1:114531:G:C    rs918310516
1:133360:T:C    rs974682326
1:541281:GGGCCAACCACAGGACA:G    rs752188509
1:564782:T:C    rs879089824
1:636747:C:T    rs974667799

My .bim file has coordinates which I want to convert to rsIDs. I am getting this output

Error: Invalid --update-name column number.

Am I missing column names Please assist

plink update-name

1 answer

  1. Remove the square brackets from your command line. See the "Interpreting our flag usage summaries" section under https://www.cog-genomics.org/plink/1.9/general_usage .
  2. Swap the order of the two numbers: "2 1" instead of "1 2". The --update-name usage summary is "--update-name <filename> [new ID col. number] [old ID col.] [skip]"; the new-ID column number comes BEFORE the old-ID column number. Or you could just remove the column numbers entirely, since "2 1" corresponds to the default behavior (this is mentioned in the first paragraph of the --update-name documentation).

Hi I have done that but my .bim file has coordinates instead of rsIDs I was expecting rsIDs

The snp_coorinates file look like this

rs2281304       1:6147134:C:A,G,T
rs11584419      1:6147341:A:C
rs2273043       1:6149053:C:T
rs2273042       1:6149122:G:A

The files.bim file looks like this

1       1:851390:G:T    0       851390  T       G
1       1:852758:G:C    0       852758  C       G
1       1:853239:A:G    0       853239  G       A

The generated .bim file is also similar to previous .bim file, I was expecting rs IDs but looks like this

1       1:730087:T:C    0       730087  C       T
1       1:752721:A:G    0       752721  A       G
1       1:754105:C:T    0       754105  T       C

Please reread the second half of my answer.

Hi when I do not add 1 and 2 in the plink command I get results but the bim in results have same coordinates instead I was expecting rsIDs. I have edited my previous comment too (the rsIDs and coordinate file has columns inverted now)

When I use --update-name 2 1 I get error Failed to open 2 when I use --update-name 1 2 it says Failed to open 1

Why did you remove the filename from your --update-name command?

Hi, I was able to solve this issue Thank you for help.

I have a question. Should snps_coordinates_rs_IDs file only have two columns or we can use a reference file of more than two columns and specify only the column of our interest??

Log in to answer this question.