This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Creating Unique Fasta Headers

hi,

I have a fast file similar to below; I have already run sed -n and down a regular expression in text wrangler to remove the headers leaving just a > followed by the sequence. The file is pretty massive and i want to know how to make each identifier unique either by using a simple python script or some other command (Not including awk due to assignment restrictions) - I've considered using linenumber = linenumber +1 for a count but I'm unsure.

I want each header to be something like s1234 with the being s1235, s1236 etc or something rather.

Thanks!

>
AGCTCAGATGCTGATCGATAGACTAG
>
GATGCTAGCTAGCTAGATCGATCGAT
>
ACGACTACAGATAGTAGATGATAGAC
fasta python shell

1 answer

I think fastx_renamer from the FASTX-Toolkit will do that: http://hannonlab.cshl.edu/fastx_toolkit/commandline.html#fastx_renamer_usage

Log in to answer this question.