Entering edit mode
2.7 years ago
Ap1438
▴
50
>1 length=424197 depth=1.05x
ATGCATGCAGTAGCAGATGCAGAGAGACAGATAG
AATAGACAGTAGACGATAGACAGTAGAGATAGAGA
ACGATGATGACCCAGTAGATGACAGTAGACAGATG
>3 length=322465 depth=0.97x
GTACATGGTAGCAGATGCAGAGAGACAGATAGAA
AATAGACAGTAGACTATAGACAGTAGAGATAGAGA
ATATAHATAHATAHAGATTHATHATACAGTATAGAT
>4 length=313463 depth=0.87x
CGTAGATCGTAGCAGATGCAGAGAGACAGATAGA
AATAGACAGTAGACGATAGACAGTAGAGATAGAGA
ATAGCAGTAGCAGTAGCAGATGACAGATGGAGAG
>6 length=285776 depth=0.79x
ATGCATGCAGTAGCAGATGCAGAGAGACAGATAG
AATAGACAGTAGACGATAGACAGTAGAGATAGAGA
TGATGACGATGACGATGGGTAGAACACCAGATGG
>7 length=281883 depth=0.90x
ATGCATGCAGTAGCAGATGCAGAGAGACAGATAG
AATAGACAGTAGACGATAGACAGTAGAGATAGAGA
GTACAGTAGACAGTAGACAGAGGGGGAGATAGGA
I have a fasta contig file which is numbered serially but for some reasons i have to remove some contigs , which resulted in gaps in the contig serial no. as shown above i.e. it became from 1,2,3,4,5,etc to 1,3,4,6,7 and so on.
So,now i want to rearrange the contigs i.e.
1 - 1
3 - 2
4 - 3
6 - 4
7 - 5 and so on till 580 (My total contigs)
AND rename them as
1 - Contig_0001
2 - Contig_0002
3 - Contig_0003 and so on till Contig_0580
I am trying it with awk print f function with increment. But i have not succeeded till now .
Thanks for your valuable time .Can anyone help me in solving this issue.
Thankyou for your valuable time and suggestion. This command is working fine.
Can you please explain the command?
What if i have a file where i want to replace something in the middle of the header and the file is in proper order
And want to change the peg_1 to peg_0001 in this header? What command will help me solve it?
You need to learn more about regular expressions.