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);
}
####
ACACTTGCATACTGATC
--*****-****---**
ACTACGACTGCATGACT
TGACTGCACT
*********-
CATGATATGT
####
ATGCATGACTACT
CTGAATGCTGACT
CGTCTGACTATAA
ATGACTTGAC
CTATGACTGA
CCGATGACTG