How to swap the headers between fasta files ?
2
0
Entering edit mode
3.9 years ago
sankadinesh ▴ 20

Dear All, I have two files file1.fasta file2.fasta. Both contain same sequences but different headers. I want to swap the headers of file 2 to file 1.

file1.fasta

>name1
atcgtatcta
>name2
ttttacgtcgcgc

file2.fasta

>otu1_name1
atcgtatcta
>otu2_name2
ttttacgtcgcgc

Thanks in advance. Regards, Dinesh S L

sequence sequencing next-gen • 811 views
ADD COMMENT
0
Entering edit mode

You can as well keep the 2nd file it self. Only headers are different between two files and if you copy headers from file 2, first file would be copy of second one. Am I missing something here?

ADD REPLY
1
Entering edit mode
3.9 years ago
ADD COMMENT
0
Entering edit mode
3.9 years ago
Jianyu ▴ 580
parallel --xapply echo ::: $(sed 'n;d' file2.fa) ::: $(sed '1d; n; d' file1.fa) | tr ' ' '\n'
ADD COMMENT

Login before adding your answer.

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