@ISA = qw( Exporter );
+use constant {
+ SCORE_FACTOR_LEN => 3,
+ SCORE_FACTOR_CORNER => 2,
+ SCORE_FACTOR_DIAG => 1,
+ SCORE_FACTOR_NARROW => 0.5,
+ VERBOSE => 0,
+};
+
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
# Generates an alignment by chaining matches, which are subsequences
# shared between two sequences. The routine functions by considering
# only matches within a given search space. If no matches are given
- # these will be generated, if long matches are found these will be
- # included in the alignment, otherwise matches will be included depending
- # on a calculated score. New search spaces spanning the spaces between
- # matches and the search space boundaries will be cast and recursed into.
+ # these will be located and matches will be included depending on a
+ # calculated score. New search spaces spanning the spaces between
+ # matches and the search space boundaries will be cast and recursed
+ # into.
# Usage: align_two_seq( { Q_SEQ => \$q_seq, S_SEQ => \$s_seq }, [] );
{
# Martin A. Hansen, August 2009
- my ( $new_match, # match
+ my ( $new_match, # match
$redundant, # hashref
) = @_;
$score_len = match_score_len( $match );
$score_corner = match_score_corner( $match, $space );
$score_diag = match_score_diag( $match, $space );
- $score_narrow = 0; #match_score_narrow( $match, $space );
+ $score_narrow = match_score_narrow( $match, $space );
$score_total = $score_len - $score_corner - $score_diag - $score_narrow;
- # print STDERR "LEN: $score_len CORNER: $score_corner DIAG: $score_diag NARROW: $score_narrow: TOTAL: $score_total\n" if $score_total > 0;
- print STDERR "LEN: $score_len CORNER: $score_corner DIAG: $score_diag NARROW: $score_narrow: TOTAL: $score_total\n";
+ printf STDERR "LEN: %d CORNER: %d DIAG: %d NARROW: %d TOTAL: %d\n", $score_len, $score_corner, $score_diag, $score_narrow, $score_total if VERBOSE;
$match->{ 'SCORE' } = $score_total;
}
# Returns integer.
- return $match->{ 'LEN' } * 2;
+ return $match->{ 'LEN' } * SCORE_FACTOR_LEN;
}
$score_corner = Maasha::Calc::min( $left_dist, $right_dist );
- return int $score_corner * 1.5;
+ return $score_corner * SCORE_FACTOR_CORNER;
}
$score_diag = $min_diag_dist;
- return int $score_diag;
+ return $score_diag * SCORE_FACTOR_DIAG;
}
$score_narrow = $max_narrow_dist;
- return abs( $beg_narrow_dist - $end_narrow_dist );
-
- return $score_narrow;
+ return $score_narrow * SCORE_FACTOR_NARROW;
}
}
}
+1;
__END__