如何利用perl程序实现批量ID名称的替换?

文件1是序列的fa文件

>AT1G01530
MGRRKVSMGLIGNRRVRAGTFGKRKEGLKKKADELSVLCGVDVALVVATADGNGGGADVW
ESNEGVLARYRTLGAEARAKHTHRAYLEGELGKGEAKLARVRQGGPDGLARWDKALDGVA
>AT1G17310
MGRRKIKMEKVQDTNTKQVTFSKRRLGLFKKASELATLCNAEVGIVVFSPGNKPYSFGKP
NFDVIAERFKNEFEEEEEGDSCETSGYSRGNRARQEKKICKRLNSITEEAEAEKKHGEDL
HKWLESAEQDKFNKPIEELTLEELKEFEAKIKKISCGIQSNISHMQASSSLMFLSNDN
>AT1G18750
MTAEEARQLLDAVDAAIRATDERRRKLGMPVDDDGEDGGAGIVLEGIAPLNFAAADEYLLH
APGGGGGDANDGQAMWGSNGIQFQQGGAANMQQAGYGFQPCITTSSSGAGMESYHLLMAP
D


文件2:
名称1            名称2

AtAGL28 AT1G01530
AtAGL100 AT1G17310
AtAGL65 AT1G18750
.......









目标新生产的文件,想把文件2里的名字替换文件1里的名字:
>AtAGL28
MGRRKVSMGLIGNRRVRAGTFGKRKEGLKKKADELSVLCGVDVALVVATADGNGGGADVW
ESNEGVLARYRTLGAEARAKHTHRAYLEGELGKGEAKLARVRQGGPDGLARWDKALDGVA
>AtAGL100
MGRRKIKMEKVQDTNTKQVTFSKRRLGLFKKASELATLCNAEVGIVVFSPGNKPYSFGKP
NFDVIAERFKNEFEEEEEGDSCETSGYSRGNRARQEKKICKRLNSITEEAEAEKKHGEDL
HKWLESAEQDKFNKPIEELTLEELKEFEAKIKKISCGIQSNISHMQASSSLMFLSNDN
>AtAGL65
MTAEEARQLLDAVDAAIRATDERRRKLGMPVDDDGEDGGAGIVLEGIAPLNFAAADEYLLH
APGGGGGDANDGQAMWGSNGIQFQQGGAANMQQAGYGFQPCITTSSSGAGMESYHLLMAP
D

请先 登录 后评论
  • 0 关注
  • 0 收藏,1044 浏览
  • 提出于 2022-10-24 14:32

相似问题