Skip to content

Commit

Permalink
minor: check of kmer size
Browse files Browse the repository at this point in the history
  • Loading branch information
jermp committed Feb 4, 2022
1 parent 23ece56 commit c9c8ca0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ to show the usage of the driver program (reported below for convenience).
For example, it could be the de Bruijn graph topology output by BCALM.

k
K-mer length (must be <= 32).
K-mer length (must be <= 31).

m
Minimizer length (must be <= k).
Minimizer length (must be < k).

[-s seed]
Seed for construction (default is 1).
Expand Down
2 changes: 1 addition & 1 deletion include/builder/build.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ void dictionary::build(std::string const& filename, build_configuration const& b
" but got k = " + std::to_string(build_config.k));
}
if (build_config.m == 0) throw std::runtime_error("m must be > 0");
if (build_config.m > build_config.k) throw std::runtime_error("m must be <= k");
if (build_config.m > build_config.k) throw std::runtime_error("m must be < k");
if (build_config.l > constants::max_l) {
throw std::runtime_error("l must be <= " + std::to_string(constants::max_l));
}
Expand Down
2 changes: 1 addition & 1 deletion include/util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace sshash {

namespace constants {
constexpr uint64_t max_k = 32;
constexpr uint64_t max_k = 31; // max *odd* size that can be packed into 64 bits
constexpr uint64_t invalid = uint64_t(-1);
constexpr uint64_t seed = 1;
constexpr uint64_t hashcode_bits = 64;
Expand Down
2 changes: 1 addition & 1 deletion src/build.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ int main(int argc, char** argv) {
"\t- one DNA sequence per line.\n"
"\tFor example, it could be the de Bruijn graph topology output by BCALM.");
parser.add("k", "K-mer length (must be <= " + std::to_string(constants::max_k) + ").");
parser.add("m", "Minimizer length (must be <= k).");
parser.add("m", "Minimizer length (must be < k).");

/* optional arguments */
parser.add("seed",
Expand Down

0 comments on commit c9c8ca0

Please sign in to comment.