Entering edit mode
7.2 years ago
m98
▴
420
I have some files generated through IMPUTE2. They all look like so:
--- 8:50000031:C:T 50000031 C T 1 0 0 1 0 0 1 0 0 1 0 0 1
--- 8:50000032:G:A 50000032 C T 1 0 0 1 0 0 1 0 0 1 0 0 1
Associated with each file, I have a list of SNPs for which I would like to change the name. For example:
rs556779 50000031
rs556780 50000032
So based on the second column (SNP position), I wish to identify the SNP in my impute file and replace its name. The output file of my example would therefore look like this:
--- rs556779 50000031 C T 1 0 0 1 0 0 1 0 0 1 0 0 1
--- rs556780 50000032 C T 1 0 0 1 0 0 1 0 0 1 0 0 1
I am not sure how best to do this, but a solution in bash would be ideal. Many thanks.