Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
jermp committed Jul 24, 2024
1 parent 05d6127 commit cb42636
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions include/info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,12 @@ double bits_per_kmer_formula(uint64_t k, /* kmer length */
assert(k > 0);
assert(k >= m);

const uint64_t N = n + M * (k - 1); // num. symbols in SPSS
const uint64_t N = n + M * (k - 1); // num. characters in SPSS

/* summing (M-1) provides an upper bound */
double num_minimizers =
(2.0 * n) / (k - m + 2) + (M - 1); // not distinct, hence num. of super-kmers

// double num_minimizers = (2.0 * n) / (k - m + 2); // not distinct, hence num. of super-kmers
// std::cout << "num_minimizers = " << num_minimizers << std::endl;
// std::cout << "minimizers: " << (3.0 * num_minimizers) / n << " [bits/kmer]" << std::endl;
// std::cout << "pieces: " << (M * (2.0 + std::ceil(std::log2(static_cast<double>(N) / M)))) / n
Expand All @@ -53,8 +56,11 @@ double bits_per_kmer_formula(uint64_t k, /* kmer length */
// << std::endl;
// std::cout << "strings: " << (2.0 * N) / n << " [bits/kmer]" << std::endl;

double num_bits = 2 * n * (1.0 + (5.0 + std::ceil(std::log2(N))) / (k - m + 2)) +
M * (2 * k + std::ceil(std::log2(static_cast<double>(n) / M + k - 1)));
// double num_bits = 2 * n * (1.0 + (5.0 + std::ceil(std::log2(N))) / (k - m + 2)) +
// M * (2 * k + std::ceil(std::log2(static_cast<double>(n) / M + k - 1)));

double num_bits = 2 * N + num_minimizers * (5.0 + std::ceil(std::log2(N))) +
M * (2.0 + std::ceil(std::log2(static_cast<double>(N) / M)));

return num_bits / n;
}
Expand Down

0 comments on commit cb42636

Please sign in to comment.