I have a tab-delimited file with codes (e.g. ctc, nmg, nml) indicating organisms (File_1):
522 ctc:CTC00972 - 506 3.20E-138
522 nmg:Nmag_3027 - 561 4.70E-73
522 nml:Namu_3564 - 566 1.80E-146
I also have a tab-delimited file that links the codes to the organism names (File_2):
ctc Clostridium_tetani_E88
nla Neisseria_lactamica
nmg Natrialba_magadii
How can I replace the codes in File_1 with the organism names in File_2?
Desired output:
522 Clostridium_tetani_E88:CTC00972 - 506 3.20E-138
522 Natrialba_magadii:Nmag_3027 - 561 4.70E-73
522 Neisseria_lactamica:Namu_3564 - 566 1.80E-146
Keeping in mind that there are thousands of these codes in the full data set and that the order of the organisms is not the same in File_1 and File_2.
nla
notnml
corresponds toNeisseria_lactamica
) – steeldriver May 16 '17 at 12:45