in reply to merge sequences with new sequence insertion
Hi,
You can read one line at a time (for I don't know how large the OP file is), chomp the line, then check if the lines meet your condition using a simply regex, and print it out with the string to insert at the end like so:
This works for me.use warnings; use strict; my $str = 'nnnnncattccattcattaattaattaatgaatgaatgnnnnn'; while(<DATA>){ chomp; print $_,$str if !/^>|^$/; } __DATA__ >contig number 11 tttgctcggaggggatc >contig number 23 gaaaacacttccttattatacaggtaaaccgtatttggat >contig number 3 aaagctcggaggggatcccct
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: merge sequences with new sequence insertion
by AnomalousMonk (Archbishop) on Nov 26, 2013 at 23:12 UTC | |
by 2teez (Vicar) on Nov 27, 2013 at 04:59 UTC |