|
ntHash
|

ntHash is an efficient rolling hash function for k-mers and spaced seeds.
Make sure Meson is installed on the system.
Download the repo (either from the releases section or close using git clone https://github.com/bcgsc/ntHash). Setup meson in an arbitrary directory (e.g. build), by running the following command in the project's root (include --prefix=PREFIX set the installation prefix to PREFIX):
Then, install the project and its dependencies using:
This will install include/nthash and lib/libnthash.a to the installation prefix.
To use ntHash in a C++ project:
#include <nthash/nthash.hpp>nthash namespaceinclude directory (pass -IPREFIX/include to the compiler)libnthash.a (i.e. pass -LPREFIX/lib -lnthash to the compiler, where PREFIX is the installation prefix)-std=c++17 (and preferably -O3) enabledRefer to docs for more information.
Generally, the nthash::NtHash and nthash::SeedNtHash classes are used for hashing sequences:
If you would like to contribute to the development of ntHash, after forking/cloning the repo, create the build directory without the release flag:
Compile the code, tests, and benchmarking script using:
If compilation is successful, libnthash.a will be available in the build folder. The benchmarking script is also compiled as the bench binary file in build.
Before sending a PR, make sure that:
meson test in the project directoryninja clang-format in the build folder (requires clang-format to be available)ninja clang-tidy-check in build returns no errors (requires clang-tools to be installed)ninja docs in build (requires doxygen)Parham Kazemi, Johnathan Wong, Vladimir Nikolić, Hamid Mohamadi, René L Warren, Inanç Birol, ntHash2: recursive spaced seed hashing for nucleotide sequences, Bioinformatics, 2022;, btac564, https://doi.org/10.1093/bioinformatics/btac564
Hamid Mohamadi, Justin Chu, Benjamin P Vandervalk, and Inanc Birol. ntHash: recursive nucleotide hashing. Bioinformatics (2016) 32 (22): 3492-3494. doi:10.1093/bioinformatics/btw397