Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
The desired output would look like this;my $mismatches = get_mismatches ($genome1, $genome2); my @strings = ($genome1, $mismatches, $genome2); for (my $x = 0; $x < length ($strings [0]); $x +=60) { print join ("\n", map (substr ($strings[$_], $x, 60), 0..2 )). "\n\n +"; } sub get_mismatches { ($genome1, $genome2) = @_; my ($length) = length ($genome1); my $position; my $count = 0; print "\n\n"; for ($position = 0; $position < $length; ++$position) { if (substr($genome1, $position, 1) eq substr ($genome2, $position +, 1)) { print "-"; } else { print "*"; } } return ($genome1, $genome2); }
but so far it looks like this;ACACTTGCATACTGATC --*****-****---** ACTACGACTGCATGACT TGACTGCACT *********- CATGATATGT
so for some reason it thinks that $mismatches is a string of DNA nOt the combination of * and - that were in the subroutine. If anyone can help i'd really appreciate it.ATGCATGACTACT CTGAATGCTGACT CGTCTGACTATAA ATGACTTGAC CTATGACTGA CCGATGACTG
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: more interweaving
by BrowserUk (Patriarch) on Nov 19, 2002 at 10:34 UTC | |
by Anonymous Monk on Nov 19, 2002 at 11:02 UTC | |
|
Re: more interweaving
by Bukowski (Deacon) on Nov 19, 2002 at 10:35 UTC |