1
$\begingroup$

I am trying to update my rsIDs in .bim file by using --update-name flag in plink but getting this error message. what could be the reason of it?

plink --bfile updated_ff  --update-name updated_ref.csv --make-bed --out test_updatedrs

PLINK v1.90b6.21 64-bit (19 Oct 2020)
Options in effect:
  --bfile updated_ff
  --make-bed
  --out test_updatedrs
  --update-name updated_ref.csv

Hostname: login1
Working directory: /gpfs/home/bsc08/bsc08856/phs001273_dbgap
Start time: Thu Jun 10 14:23:44 2021

Random number seed: 1623327824
96310 MB RAM detected; reserving 48155 MB for main workspace.
Allocated 15236 MB successfully, after larger attempt(s) failed.
Error: Line 1 of updated_ref.csv has fewer tokens than expected.

My updated_ref.csv file looks like this

Name,chrpos
rs3793692,chr10_100008436
rs1983865,chr10_100016339
newrs150271620,chr10_100017402
rs10736126,chr10_100025924
chr10_100044928_A_G,chr10_100044928
rs7905091,chr10_100046078
rs6584182,chr10_100055644
chr10_100058710_C_T,chr10_100058710
rs4360594,chr10_10007547
rs927739,chr10_100077732
rs4917817,chr10_100085888

while my .bim looks like this

1 rs3094315 0 752566 G A
1 rs3131972 0 752721 A G
1 chr1770377 0 770377 T A
1 rs11240777 0 798959 A G
1 chr1834753 0 834753 C G
1 rs72890788 0 836924 A G
1 rs4970383 0 838555 A C
1 chr1840753 0 840753 G A

1 rs4475691 0 846808 A G
$\endgroup$
2
$\begingroup$

The reason is (likely) that plink is expecting a space separated file for the --update-name argument:

--update-name <filename> [new ID col. number] [old ID col.] [skip]

You've given it a comma-separated file, so it thinks there is only one column, hence the error. You also don't want column names.

Change the sep by:

sed 's/,/ /g' updated_ref.csv > updated_ref.txt

Or, edit the file in place, and keep a backup of the original named updated_ref.csv.bak :

sed -i.bak 's/,/ /g' updated_ref.csv > updated_ref.txt
$\endgroup$
2
  • $\begingroup$ Do you mean cat updated_ref.csv | sed -i 's/,/ /g' > updated_ref.txt according to my data and it will convert my .csv into .txt? $\endgroup$ – Aryh Jun 10 at 13:01
  • $\begingroup$ See update to my post $\endgroup$ – user438383 Jun 10 at 13:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.