Help for this page

Select Code to Download


  1. or download this
    01    my ( $pattern, $mismatches_allowed ) = @_;
  2. or download this
    02    if ( $mismatches_allowed == 0 ) { return $pattern }
  3. or download this
    03    elsif ( length($pattern) <= $mismatches_allowed ) {
    04        $pattern =~ tr/ACTG/./;
    05        return $pattern;
    06    }
    
  4. or download this
    07    else {
  5. or download this
    08        my ( $first, $rest ) = $pattern =~ /^(.)(.*)/;
  6. or download this
    09        my $after_match = make_approximate( $rest, $mismatches_allowed );
  7. or download this
    10        if ( $first =~ /[ACGT]/ ) {
    11            my $after_miss = make_approximate( $rest, $mismatches_al
    +lowed - 1 );
    12            return (?:$first$after_match|.$after_miss);
    13        }
    
  8. or download this
    14        else { return $first$after_match }
    15    }