Hi guys,
I have a problem please help if you have any solutions.
I have two files. FILE1 having records separated by '>'
FILE1
>LOG_Ps04g30040.1|12004.m08110|test lc-like prot, test1
MGASPSREEAHSNSSFSGNGKAMAVASSASSSGSNQAQSKRAPALHMFQEIVAEKDFTAS
LPKQ*
>ab|22329085|xyz|PP_194957.2| (CALRE);on biding [liana]
MGLPQNKLSFFCFFFLVSVLTLAPLAFSEIFLEEHFEGGWKSRWVLSDWKRNEGKAGTFKHTAGKWPGD
DNKGIQTYNDAKHYAISAKIPEFSNKNRTLVVQYSVKIEQDIECGGAYIKLLSGYVNQKQFGGDTPYSL
HDEL
>pnl_A5C9U1_VITVI A7Q0M0 chr scaffold_42,shotgun
MKLLSGEVDQKKFGGDTPYSIMFGPDICGYSTKKVHAIFSYQGSNHLIKKDVPCETDQLT
HVYTFVLRPDATYSILIDNVEKQSGSLYSDWDILPPKQIKDAKAKKPEAWDDKEYIPDPE
WKAPMIDNPDFKDDPDFFIYPHLKYVGIELWQVKSG*TMFDNILVCDDPDYAKKLAEETW
KHKGAEKTAFEEQEKKREEEESKDDPDDSDVSSIKSLPGFH
>Glyta16g22680.1
MSFEDSSKKHQSVGPWGGNGGSRWDDGIYSGVRQLVIVHGTGIDSIQIEYDKKGSSIWSEKHGGSGGRK
KVKSKKHQSVGPWGGNGGSRWDDGIYSGVRQLVIVHGTGIDSIQIEYDKKGSSIWSEKHGGSGGRKTIK
NAKKPEDWDDREYIDDPNDVKPEGFDSIPREIPDRKAKEPEDWDEEENGLWEPPKIPNSA
>cgi|Poptr1_1|555048|eu3.00031681 on binding [test2]
MGLPQNKLSFFCFFFLVSVLTLAPLAFSEIFLEEHFEGGWKSRWVLSDWKRNEGKAGTFKHTAGKWPGD
DNKGIQTYNDAKHYAISAKIPEFSNKNRTLVVQYSVKIEQDI
I want to arrange the records in the same order as they are in FILE2. It only contains the text before the first space in the line containing '>'.
FILE2
cgi|Poptr1_1|555048|eu3.00031681
pnl_A5C9U1_VITVI
ab|22329085|xyz|PP_194957.2|
Glyta16g22680.1
LOG_Ps04g30040.1|12004.m08110|test
The OUTPUT should be like this -
>cgi|Poptr1_1|555048|eu3.00031681 on binding [test2]
MGLPQNKLSFFCFFFLVSVLTLAPLAFSEIFLEEHFEGGWKSRWVLSDWKRNEGKAGTFKHTAGKWPGD
DNKGIQTYNDAKHYAISAKIPEFSNKNRTLVVQYSVKIEQDI
>pnl_A5C9U1_VITVI A7Q0M0 chr scaffold_42,shotgun
MKLLSGEVDQKKFGGDTPYSIMFGPDICGYSTKKVHAIFSYQGSNHLIKKDVPCETDQLT
HVYTFVLRPDATYSILIDNVEKQSGSLYSDWDILPPKQIKDAKAKKPEAWDDKEYIPDPE
WKAPMIDNPDFKDDPDFFIYPHLKYVGIELWQVKSG*TMFDNILVCDDPDYAKKLAEETW
KHKGAEKTAFEEQEKKREEEESKDDPDDSDVSSIKSLPGFH
>ab|22329085|xyz|PP_194957.2|(CALRE);on biding [liana]
MGLPQNKLSFFCFFFLVSVLTLAPLAFSEIFLEEHFEGGWKSRWVLSDWKRNEGKAGTFKHTAGKWPGD
DNKGIQTYNDAKHYAISAKIPEFSNKNRTLVVQYSVKIEQDIECGGAYIKLLSGYVNQKQFGGDTPYSL
HDEL
>Glyta16g22680.1
MSFEDSSKKHQSVGPWGGNGGSRWDDGIYSGVRQLVIVHGTGIDSIQIEYDKKGSSIWSEKHGGSGGRK
KVKSKKHQSVGPWGGNGGSRWDDGIYSGVRQLVIVHGTGIDSIQIEYDKKGSSIWSEKHGGSGGRKTIK
NAKKPEDWDDREYIDDPNDVKPEGFDSIPREIPDRKAKEPEDWDEEENGLWEPPKIPNSA
>LOG_Ps04g30040.1|12004.m08110|test lc-like prot, test1
MGASPSREEAHSNSSFSGNGKAMAVASSASSSGSNQAQSKRAPALHMFQEIVAEKDFTAS
LPKQ*
Thanks