Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
adamant-pwn committed Jul 25, 2024
2 parents 72a92b6 + fdfa686 commit ad6cee4
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions include/info.impl
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,13 @@ static 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

// 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
// << " [bits/kmer]" << std::endl;
// std::cout << "num_super_kmers_before_bucket: " << (2.0 * num_minimizers) / n << " [bits/kmer]
// "
// << std::endl;
// std::cout << "offsets: " << (std::ceil(std::log2(N)) * num_minimizers) / n << " [bits/kmer]"
// << std::endl;
// std::cout << "strings: " << (2.0 * N) / n << " [bits/kmer]" << std::endl;
/* summing (M-1) provides an upper bound to the num. of super-kmers */
double Z = (2.0 * n) / (k - m + 2) + (M - 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 + Z * (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 ad6cee4

Please sign in to comment.