how to change header of fasta file
1
0
Entering edit mode
12 months ago

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

sequence next-gen • 560 views
0
Entering edit mode

What have you tried? bioawk (or even plain awk) should be able to help you with this.

0
Entering edit mode

This will give you a hint.
A: Renaming Entries In A Fasta File

1
Entering edit mode
12 months ago
awk '/^>/{print ">ASV" ++i; next}{print}' < file.fasta


this one works perfectly for this kind of issue. Thanks for your both @Medhat and @RamRS

0
Entering edit mode

0
Entering edit mode

Thanks for informing me this. Again, thank for your help!