I have a sequence files (input_file.txt) with huge number of contigs such as (contig number does not reflect the order):
>contig number 11
tttgctcggaggggatc>contig number 23
gaaaacacttccttattatacaggtaaaccgtatttggat>contig number 3
aaagctcggaggggatcccct... ..
I want to concatenate the contigs such that the above order is preserved, and also, I want to insert the sequence "nnnnncattccattcattaattaattaatgaatgaatgnnnnn" in each contig boundaries (here are two contig boundaries), such that the final output file would become as follows:
>concatenated contig tttgctcggaggggatcnnnnncattccattcattaattaattaatgaatgaatgnnnnngaaaacactt +ccttattatacaggtaaaccgtatttggatnnnnncattccattcattaattaattaatgaatgaatgn +nnnnaaagctcggaggggatcccct
For concatenation purpose, I use
perl -pe "chomp;s/>.+//" input_file.txt >output_file.txtBut I don't know how to insert the sequence in each contig boundary, plz help..
In reply to merge sequences with new sequence insertion by utpalmtbi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |