Skip to content

Commit

Permalink
minor optimization on alignment score function
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhermesena1 committed Jul 10, 2020
1 parent a782fa4 commit e3c6b9d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/abismal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ namespace align_scores {
static const score_t match = 1,
mismatch = -1,
indel = -1;
static const vector<score_t> score_lookup = {match, mismatch};
};

struct ReadLoader {
Expand Down Expand Up @@ -787,8 +788,7 @@ prep_for_seeds(const Read &pread_seed, Read &pread_even, Read &pread_odd) {

static inline score_t
mismatch_score(const char q_base, const uint8_t t_base) {
return the_comp(q_base, t_base) ?
align_scores::mismatch : align_scores::match;
return align_scores::score_lookup[the_comp(q_base, t_base)];
}

template <score_t (*scr_fun)(const char, const uint8_t),
Expand Down

0 comments on commit e3c6b9d

Please sign in to comment.