how to change header of fasta file
1
0
Entering edit mode
4.1 years 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 • 1.9k views
ADD COMMENT
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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

ADD REPLY
1
Entering edit mode
4.1 years 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

ADD COMMENT
0
Entering edit mode

Thank you for following up. Please accept your answer so the question is marked as solved.

ADD REPLY
0
Entering edit mode

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

ADD REPLY

Login before adding your answer.

Traffic: 1684 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6