in reply to formatting output question (use of recursive subroutine?)
If you really need to put more than one match per line and don't care about efficiency (using the fewest number of total lines), you can use a bit mask to determine if "this" strand needs to go on to the next line. If you need help with that, speak up.my $dna = 'gctagctgatgctagcagcagcatgtagctagctgacga'; for my $strand (@fragment) { my $pos = index($dna, $strand); next if $pos == -1; my $pad = ' ' x $pos; print $pad, $strand, "\n"; }
Cheers - L~R
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: formatting output question (use of recursive subroutine?)
by rogerd (Sexton) on Jul 29, 2008 at 22:29 UTC | |
by Limbic~Region (Chancellor) on Jul 30, 2008 at 00:05 UTC | |
by rogerd (Sexton) on Jul 30, 2008 at 01:44 UTC | |
by Limbic~Region (Chancellor) on Jul 30, 2008 at 02:34 UTC |