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
How To Rename FASTA Headers
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.