utpalmtbi has asked for the wisdom of the Perl Monks concerning the following question:
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..
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: merge sequences with new sequence insertion
by hdb (Monsignor) on Nov 26, 2013 at 20:33 UTC | |
|
Re: merge sequences with new sequence insertion
by boftx (Deacon) on Nov 26, 2013 at 20:22 UTC | |
|
Re: merge sequences with new sequence insertion
by rnaeye (Friar) on Nov 27, 2013 at 02:54 UTC | |
|
Re: merge sequences with new sequence insertion
by 2teez (Vicar) on Nov 26, 2013 at 21:28 UTC | |
by AnomalousMonk (Archbishop) on Nov 26, 2013 at 23:12 UTC | |
by 2teez (Vicar) on Nov 27, 2013 at 04:59 UTC | |
|
Re: merge sequences with new sequence insertion
by oiskuu (Hermit) on Nov 26, 2013 at 22:32 UTC | |
|
Re: merge sequences with new sequence insertion
by Kenosis (Priest) on Nov 26, 2013 at 20:41 UTC |