Alternatively: paste -d '' file1 file2 | sed 's/>/:/2' or e.g. paste -d '' file1 <(tr ">" ":" <file2)
• 0 views
•
link
I have two fasta files with different header and sequences and would like to append them one after the other in the same sequential order
Input: first file
>RNA1
AATGACGATGACGATGACAGAT
>RNA2
ATAGATGGGCAGTAGAGA
File2:
>mRNA1
ATGGAGATGAGAT
>mRNA2
AGATGGGGATGA
Ouput file should be
>RNA1:mRNA1
AATGACGATGACGATGACAGATATGGAGATGAGAT
>RNA2:mRNA2
ATAGATGGGCAGTAGAGAAGATGGGGATGA
assuming all fasta have two lines per record (name+seq)
paste f1.fasta f2.fasta | sed -e '/^>/s/\t>/:/' -e '/^[^>]/s/\t//'
Log in to answer this question.
And what have you tried?
I have tried the EMBOSS tool pasteseq which appends only the first sequence but does not retrieve the identifiers
cat file1.fa file2.fa > both.faIf you will deal with bioinformatics I advice you to read this:
http://www.vicbioinformatics.com/documents/command-line/#/
http://userweb.eng.gla.ac.uk/umer.ijaz/bioinformatics/linux.html
https://sites.ualberta.ca/~stothard/downloads/linux_for_bioinformatics.pdf
I don't think that is what OP has in mind. Sequences should be concatenated together and identifiers too.
that is right my bad