My fasta headers of my FASTA file go like this:
>M02529:151:000000000-AJBNG:1:1101:20806:3573:133
TGGGGAATTGTTCGCAATGGGCGCAAGCCTGACGACGCAACGCC
>M02529:151:000000000-AJBNG:1:1101:8182:3623:133
TCGAGAATAATTCACAATGGGGGCAACCCTGATGGTGCAACGCCG
The "133" is the sample name, and I need it at the beginning of the header followed by a dot, like this:
>:133.M02529:151:000000000-AJBNG:1:1101:20806:3573
TGGGGAATTGTTCGCAATGGGCGCAAGCCTGACGACGCAACGCC
>:133.M02529:151:000000000-AJBNG:1:1101:8182:3623
TCGAGAATAATTCACAATGGGGGCAACCCTGATGGTGCAACGCCG
I would be glad to get a 'sed' or 'awk' command to do it and modify my FASTA file. Thanks a lot!
Cheers!
Are you sure its always 4 characters and not "the characters after the last semicolon, plus the semicolon itself"?
In this case, the last 4 characters work (they range btw 133-166). However, I also take your suggestion as an option, thanks!