Entering edit mode
4.4 years ago
KG
▴
10
I have about 100 multiple fasta files (e.g., file.faa), which I have to rename with the species name mentioned in the fasta header. The fasta headers of these files are in the following format:
>XP_003072227.1 aminopeptidase N [Encephalitozoon intestinalis ATCC 50506]
How do I rename 'file.faa' to 'Encephalitozoon intestinalis.faa'?
I saw that people have used awk and sed for a similar purpose but could not figure out what I have to do. Any help is appreciated.
Thank you.
See answers here for inspiration: Rename FASTA files according to FASTA file header
You will need to make some changes to the solutions. Please do not use spaces in file names even though your OS may allow them.
I have tried doing
This changed 'file.faa' to 'XP_003072227.1.faa' but I need 'Encephalitozoon intestinalis.faa'.
How to modify the script?