Skip to content

Commit

Permalink
updating many of the magic numbers in the code. These numbers are fur…
Browse files Browse the repository at this point in the history
…ther explained in a separate markdown file
  • Loading branch information
guilhermesena1 committed Jun 4, 2021
1 parent 38cf8a4 commit 6b934fc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/AbismalAlign.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ struct AbismalAlign {
const size_t q_sz_max;
const size_t bw;

static const uint16_t max_off_diag = 2;
static const uint16_t max_off_diag = 4;
};

template <score_t (*scr_fun)(const uint8_t, const uint8_t),
Expand Down Expand Up @@ -239,8 +239,8 @@ namespace simple_aln {
static const score_t match = 1;
static const score_t mismatch = -1;
static const score_t indel = -1;
static const score_t min_diffs_to_align = 1;
static const std::array<score_t, 2> score_lookup = {match, mismatch};
static const score_t min_diffs_to_align = 4;

inline score_t default_score(const uint32_t len, const score_t diffs) {
return match*(len - diffs) + mismatch*diffs;
Expand Down
14 changes: 6 additions & 8 deletions src/AbismalIndex.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,17 @@ namespace seed {
static const uint32_t key_weight = 26;

// window in which we select the best k-mer
static const uint32_t w_index = 20;

// GS: must be >= w_index to guarantee the minimizer was indexed
static const uint32_t w_map = 30;

// max k-mers used for comparison
static const size_t max_seeds = 5;
static const uint32_t window_size = 30;

// number of positions to sort within buckets
static const uint32_t n_sorting_positions = 128;

// seed size during mapping, or size of a two-letter exact match
static const uint32_t n_seed_positions = 32;
static const uint32_t n_seed_positions = 26;

// maximum number of candidates per seed as function of
// overrepresented k-mers
static const double overrep_kmer_quantile = 1e-6;

static const size_t hash_mask = (1ull << seed::key_weight) - 1;

Expand Down
4 changes: 2 additions & 2 deletions src/abismal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ struct se_candidates {
static const uint32_t max_size;
};

const uint32_t se_candidates::max_size = 200;
const uint32_t se_candidates::max_size = 20;

inline bool
chrom_and_posn(const ChromLookup &cl, const string &cig, const uint32_t p,
Expand Down Expand Up @@ -443,7 +443,7 @@ struct pe_candidates {
static const uint32_t max_size;
};

const uint32_t pe_candidates::max_size = 400;
const uint32_t pe_candidates::max_size = 100;

inline double pct(const double a, const double b) {return 100.0*a/b;}

Expand Down

0 comments on commit 6b934fc

Please sign in to comment.