Thank you for following up. Please accept your answer so the question is marked as solved.
• 0 views
•
link
Hello all, I have the following fasta file, but I want to change the header, please give mea hint, Thanks a lot
>7a11faf04904a091a0150f1de2091c13
GATCGAAGGAATCGGTCCGCCGTCA
>f04f5b529914f21e583996fbe22db642
GGACCTGGCCGGGCGGTCCGCTTTACGGCGTG
...
...
>503af07882c049f957b6a11c7d551400
TTCGAGCTCGACAAGTGGTCTAGGATTTTCCGAGTACTGTCTTGTCGAGCTC
Here is the what I want:
>ASV1
GATCGAAGGAATCGGTCCGCCGTCA
>ASV2
GGACCTGGCCGGGCGGTCCGCTTTACGGCGTG
...
>ASV1008
TTCGAGCTCGACAAGTGGTCTAGGATTTTCCGAGTACTGTCTTGTCGAGCTC
awk '/^>/{print ">ASV" ++i; next}{print}' < file.fasta
this one works perfectly for this kind of issue. Thanks for your both @Medhat and @RamRS
Log in to answer this question.
What have you tried?
bioawk(or even plain awk) should be able to help you with this.This will give you a hint.
A: Renaming Entries In A Fasta File