How to add name to Fasta header
0
0
Entering edit mode
20 months ago
ledba • 0

Hello everyone,

I have several fasta files and a tab separated text file with names of each file and their id on each line:

exemple he fasta file looks like this: shiroborus—colonus.fasta

>scaffold_1
ACTGCGCGATAGATAGAT
>scaffold_2
ACTGCGCGATAGATAGAT
>scaffold_3
ACTGCGCGATAGATAGAT

The tab separated text file looks like this:

id|124452|           shiroborus—colonus
id|124499|           tabroborus—virulus
id|1654502|           shirus—rhizobus

results fasta file :

>id|124452|shiroborus—colonus|scaffold_1
ACTGCGCGATAGATAGAT
>id|124452|shiroborus—colonus|scaffold_2
ACTGCGCGATAGATAGAT
>id|124452|shiroborus—colonus|scaffold_3
ACTGCGCGATAGATAGAT

I would like to replace each header of each fasta file by the corresponding line of each fasta file. Thanks a lot!

python • 789 views
ADD COMMENT
0
Entering edit mode

What have you tried?

What is the correspondence between the headers and the scaffolds? Are they guaranteed to be in the right order in the tab file?

ADD REPLY
0
Entering edit mode

hello, i tried and i succeeded

ADD REPLY
0
Entering edit mode

Please add the solution that worked for you as an answer here so it helps some other soul in future. You can accept your own answer to make the thread as complete.

ADD REPLY

Login before adding your answer.

Traffic: 2633 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