Modify fasta file header
I am a newbi for linux stuff... I would like to modify the header of fasta file. My header is like: >100123_00010T gene=100123_00010 And, I would like to have headers like "100123_00010"
Would you give me some advise to get that result?
• 1,766 views
•
link
1 answer
obligatory seqkit answer
seqkit replace -p ".+gene=(.+)" -r "\$1" input.fa -o output.fa
• 0 views
•
link
Log in to answer this question.
This is a frequently asked question on biostars with many answers.
will most likely suffice.
If you remove the leading
>then the file will no longer be in fasta format.For a fasta you could just do
awk '{print $1}' test.faHere are some other options. It's good to try a search first when you have questions.