Skip to content

Commit

Permalink
Allow penalized in global alignment (fix)
Browse files Browse the repository at this point in the history
  • Loading branch information
s-will committed May 8, 2018
1 parent 22d32da commit 71e5e2d
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 9 deletions.
5 changes: 4 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<<<<<<< HEAD
=== 2018


2.0.0RC5 (2018-05-08)
Allow penalized in global alignment

2.0.0RC4 (2018-05-04)
Bugfixes:
---------
Expand All @@ -18,7 +22,6 @@
------------------------
Add stopwatch (for consensus computation)
Introduce parameter --consensus-gamma for mea consensus 'gamma'
Allow penalized in global alignment

API:
------------------------
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ dnl -*- Autoconf -*-
dnl Process this file with autoconf to produce a configure script.

AC_PREREQ(2.59)
AC_INIT([LocARNA], [2.0.0RC4], [will@informatik.uni-freiburg.de], [locarna],
AC_INIT([LocARNA], [2.0.0RC5], [will@informatik.uni-freiburg.de], [locarna],
[http://www.bioinf.uni-freiburg.de/Software/LocARNA/])

dnl special dir for aux config files
Expand Down
17 changes: 11 additions & 6 deletions src/LocARNA/aligner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -733,14 +733,15 @@ namespace LocARNA {

// align the top level in case of free end gaps
//
template <class ScoringView>
infty_score_t
AlignerImpl::align_top_level_free_endgaps() {
AlignerImpl::align_top_level_free_endgaps(const ScoringView *sv) {

M_matrix_t &M = Ms_[E_NO_NO];

init_state(E_NO_NO, r_.startA() - 1, r_.endA() + 1, r_.startB() - 1,
r_.endB() + 1, !params_->free_endgaps_.allow_left_2(), false,
!params_->free_endgaps_.allow_left_1(), false, &def_scoring_view_);
!params_->free_endgaps_.allow_left_1(), false, sv);

// need to handle anchor constraints:
// search maximum to the right of (or at) rightmost anchor constraint
Expand All @@ -761,7 +762,7 @@ namespace LocARNA {

for (pos_type j = min_col; j <= max_col; j++) {
M(i, j) = align_noex(E_NO_NO, r_.startA() - 1, r_.startB() - 1,
i, j, &def_scoring_view_);
i, j, sv);
}
}

Expand Down Expand Up @@ -936,7 +937,7 @@ namespace LocARNA {

// align toplevel globally with potentially free endgaps (as given
// by description params_->free_endgaps)
return align_top_level_free_endgaps();
return align_top_level_free_endgaps(&def_scoring_view_);

// Without free end gaps, we could call (much simpler):
// (we just call the more general method
Expand Down Expand Up @@ -1608,8 +1609,12 @@ namespace LocARNA {

mod_scoring_view->set_lambda(position_penalty);

infty_score_t score =
align_top_level_locally(mod_scoring_view.get());
infty_score_t score;
if (params_->sequ_local_) {
score = align_top_level_locally(mod_scoring_view.get());
} else {
score = align_top_level_free_endgaps(mod_scoring_view.get());
}

trace(mod_scoring_view.get());

Expand Down
3 changes: 2 additions & 1 deletion src/LocARNA/aligner_impl.hh
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,9 @@ namespace LocARNA {
* align the top-level with potential free end gaps
* and return the maximal score
*/
template <class ScoringView>
infty_score_t
align_top_level_free_endgaps();
align_top_level_free_endgaps(const ScoringView *s);

/**
* align the top-level in a sequence local alignment
Expand Down
1 change: 1 addition & 0 deletions src/locarna.cc
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@ run_and_report() {
clp.sequ_local = true;
}
}

//
// important: in the Aligner class, we rely on sequ_local==true in
// normalized alignment mode
Expand Down

0 comments on commit 71e5e2d

Please sign in to comment.