I have a file seq.txt which consists of multiple aligned sequences:
B_phora_cucurbitarum -----------------------------------------------------MSHIKRD
E_aceosorus_bombacis RAQAPPGSHNDQPPLLDPLSGILSPLGLGGLTPRSDSLPEHLEMQRRHILERLNERDEDV
A_nfragosa_RCEF_1005 ---------------------------------------------------MKYSILHLA
X_crodochium_bolleyi -------------------------------------------MRLSNIAGQLAVGAACL
R_cillium_camemberti --------------------------------------MRILTTGLLLWLLSLINLVSAF
[Bin ]
B_phora_cucurbitarum LSRISGGIGGFLSSIANNIYVFSWDFSLFLLNLVAFKRKVGKVTLEGNPGFGGKWPEYIP
E_aceosorus_bombacis RAQAPPGSHNDQPPL--------QLAVGAACLEHLEM------------LERLNERDEDV
A_nfragosa_RCEF_1005 ---------MTENALSAEDLAKRG---LDKREVSYTGRITTTFDAAAQLVSNTGVHAFQA
X_crodochium_bolleyi NDQPPLLDPLSGILSPLGLGGLTP------------------MRL-SNIAGQLAVGAACL
R_cillium_camemberti -------------------------MS------DIPVHQHSDGRCPVTGISGSNPHPFCP
[Bin ]
I want to combine them in a single line according to their names like this:
>B_phora_cucurbitarum -----------------------------------------------------MSHIKRDLSRISGGIGGFLSSIANNIYVFSWDFSLFLLNLVAFKRKVGKVTLEGNPGFGGKWPEYIP
>E_aceosorus_bombacis RAQAPPGSHNDQPPLLDPLSGILSPLGLGGLTPRSDSLPEHLEMQRRHILERLNERDEDVRAQAPPGSHNDQPPL--------QLAVGAACLEHLEM------------LERLNERDEDV
>A_nfragosa_RCEF_1005 ---------------------------------------------------MKYSILHLA---------MTENALSAEDLAKRG---LDKREVSYTGRITTTFDAAAQLVSNTGVHAFQA
>X_crodochium_bolleyi -------------------------------------------MRLSNIAGQLAVGAACLNDQPPLLDPLSGILSPLGLGGLTP------------------MRL-SNIAGQLAVGAACL
>R_cillium_camemberti --------------------------------------MRILTTGLLLWLLSLINLVSAF-------------------------MS------DIPVHQHSDGRCPVTGISGSNPHPFCP
Awk or sed commands are preferred, any help would be appreciated. Thanks!
Did you try something yourself with some forums examples close to your question ?
https://stackoverflow.com/questions/18092469/combining-columns-within-a-single-file-using-awk
https://unix.stackexchange.com/questions/224135/merging-columns-in-a-file-using-awk
https://www.unix.com/shell-programming-and-scripting/267681-merge-columns-two-files-using-awk.html
https://stackoverflow.com/questions/7068314/awk-combining-multiple-lines-conditionally
https://www.unix.com/shell-programming-and-scripting/208027-merge-multiple-lines-same-file-common-key-using-awk.html
Yes, I tried but they don't make my case.