Entering edit mode
2.6 years ago
bionix
▴
10
Hello, I have a list of sequences in a fasta file which looks like this:
>WP00001_00001 HP Protein 1
ATGCATGATCAGTTGACGT
>WP00002_00022 Protein Like/Protein1
ATGACTGACGTTGACGTAC
>WP00002_00007 Protein cluster2
ATGGCTAGCCATGTACATT
I want to replace the first white space with a pipe (|) and then replace all other white space in the header (description) with an underscore (_). So that the final output file should look like this:
>WP00001_00001|HP_Protein_1
ATGCATGATCAGTTGACGT
>WP00002_00022|Protein_Like/Protein1
ATGACTGACGTTGACGTAC
>WP00002_00007|Protein_cluster2
ATGGCTAGCCATGTACATT
Could you please help me with that?
Regards, PSP
What have you tried? The forum has a number of "edit FASTA/Q header" posts.