This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Change Fasta Id'S

Hello,

I've got multiple blast hits in a fasta file. But I want the description, instead of accessions. So when I make a tree, I get nice names.

For example:

>gi|255587543|ref|XM_002534260.1| Ricinus communis Protein kinase APK1B, chloroplast precursor, putative, mRNA

To:

>Ricinus_communis_APK1B

I know this can be done by hand, but there's just too many of them!

Hope you can help me.

fasta identifiers

With what do you want help? This task and many like it is quite simple using e.g. a Perl or shell script. Is that what you would like to learn? Right now, the tone of the question suggests that you just want someone to do it for you. That does not help you, in the long run or the people with the answer, in the short term.

2 answers

duplicate of

Any Script to parse fasta headers?

Fire up perl: If starts with > , regex to extract between pipe and comma, print >[regex] else print.

Further info: http://learn.perl.org/

Log in to answer this question.