How to rename/replace the multiline fasta subsequence header in a fasta file?
0
2
Entering edit mode
3.6 years ago
sunnykevin97 ▴ 990

HI,

I had 1000's fasta sequences. How to rename/replace the fasta subsequence headers,

   >TRINITY ID's with >species names (given below).

1.  >species1 2. >species2 3. >species3 4. >species4 5. >species5
6. >species6 7. >species7 8. >species8 9. >species9

>TRINITY_DN9_c0_g1_i1.p1
-----------------MPMKGRFPIRRTLEFLRSGTVVFKDSVKILTVNYNTHGERSDGTIMGKNDVLVEADEQVQKEHSHPAHFGPKKYCLRECICEVEGQVPCPGVVPLPKEMTGK
>TRINITY_DN28727_c0_g1_i2.p1
--------------GAAMPMKGRFPVRRTLEFLRSGAVVFKDSVKILTVNYNTHGERSDGARKFVFFNVPQIQYQNPWVQIVMFKNLTPSPCLRFYLDDGEQVLVDVEGKNHKE
>TRINITY_DN850_c1_g3_i2.p1
-----------------MPMKGRFPIRRTLEFLRSGSVVFEDSVKILTVNYNTHGERSDGARKFVFFNIPQIQYQNPWVQILMFKNMTPSPFLRFYLDDGEQVLVDVEGKNHKQIVEH
>TRINITY_DN4685_c1_g1_i1.p1
-----------------MPMKGRFPVRRTLEFLRSGTVVFKDSVKVLTVNYNTHGERSDGARKFVFFNIPQIQYRNPWVQILMFKNMTSSPFLRFYLNDGEQVLVDVEGKNHKQIVEH
>TRINITY_DN6780_c0_g1_i1.p1
-----------------MPMKGRFPIRRTLEFLRSGSVVFKDSVKILTVNYNTHGERSDGARKFVFFNIPQIQYQNPWVQILMFKNMTPSPFLRFYLDDGEQVLVDVEGKNHKQIVEH
>TRINITY_DN4216_c0_g2_i2.p1
-----------------MPMKGRFPIRRTLEFLRSGSVVFKDSVKIVTVNYNTHGERSDGARKFVFFNIPQIQYQNPWVQILMFKNMTPSPFLRFYLNDGEQVLVDVEGKNHKQIVEH
>TRINITY_DN4187_c9_g1_i1.p1
-----------------MPMKGRFPIRRTLEFLRSGSVVFKDSVKILTVNYNTHGERSDGARKFVFFNIPQIQYQNPWVQILMFKNMTPSPFLRFYLDDGEQVLVDVEGKNHKQIVEH
>TRINITY_DN54_c1_g2_i1.p1
MRGARRRKCAGVVWEAAMPMKGRFPIRRTLEFLRSGSVVFKDSVKILMVNYNTHGERSDGARKFVFFNIPQIQYQNPWVQILMFKNMTPSPFLRFYLDDGEQVLVDVEG
>TRINITY_DN221_c0_g1_i1.p1
----------------AMPMKGRFPIRRTLEFLRSGSVVLKDSVKILTVNYNTHGERSDGVRKFVFFNIPQIQYQNPWVQILMFKNMTPSPFLRFYLGDGEQVLVDVEGKNHKQIVEH

**Desired output**
> species1
asdfghjkl
> species2
asdfghjkl
....
....
> species9
poiuytre
DNA alignment fasta RNA • 1.4k views
ADD COMMENT
2
Entering edit mode
ADD REPLY
2
Entering edit mode

I find a very easy perl script to do the rename/replace the headers. given in this thread, replace fasta headers with another name in a text file @Kenosis.

ADD REPLY

Login before adding your answer.

Traffic: 2000 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6