This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How would I quickly edit the fasta ID of each entry in a fasta file using BioPython?

I'm trying to get acquainted with biopython as I've never used it before. I have a fasta that looks like this:

>name1_name1

ATCGATCG

>name2_name2

ATCGATCG

etc.. Unfortuantely the names are repated for some whatever reason, and I want to edit the fasta such that it's normal, like

>name1

ATCGATCG... etc

What's the cleanest way to do this?

biopython biopython

You should have a look at SeqIO, in which you can have a seqrecord object and edit the description attribute. Let me know if you can 't get it working!

0 answers

No answers yet.

Log in to answer this question.