Bioinformatics Technology Lab common code library in C++ with Python wrappers.
The recommended way is to download using Conda package manager:
conda install -c bioconda -c conda-forge btllib
Alternatively, you can compile the code from source. Download btllib-$VERSION.tar.gz
from the GitHub latest release where $VERSION
is the latest btllib version and do the following:
tar xzf btllib-$VERSION.tar.gz
to extract the source code.btllib/compile
btllib/install
directory. You can provide the --prefix
parameter to change this.CXX
environment variable to point to the compiler before running btllib/compile
.python3 -m pip install $PREFIX/lib/btllib/python
afterwards to install the Python package. The Python wrappers are usable even without this step. $PREFIX
is the path where btllib is installed.$PREFIX
is the path where btllib is installed):
$PREFIX/lib/libbtllib.a
(pass -L $PREFIX/lib -l btllib
flags to the compiler).
export CPPFLAGS="-isystem /path/to/btllib/install/include $CPPFLAGS"
export LDFLAGS="-L/path/to/btllib/install//lib -lbtllib $LDFLAGS"
#include
any header from the $PREFIX/include
directory (pass -I $PREFIX/include
flag to the compiler).btllib
uses C++11
features, so that standard should be enabled at a minimum.python3-config
to determine the flags used for compilation. Running python3-config --exec-prefix
will give the path to the Python installation that needs to be used. The python3
executable can be found at $(python3-config --exec-prefix)/bin/python3
.btllib::SeqReader::Flag
in C++ versus btllib.SeqReaderFlag
in Python), and (Kmer)CountingBloomFilter which provides CountingBloomFilter8
, CountingBloomFilter16
, CountingBloomFilter32
, KmerCountingBloomFilter8
, KmerCountingBloomFilter16
, CountingBloomFilter32
with counters 8, 16, and 32 bits wide.PYTHONPATH
environment variable or sys.path.append()
in your Python code to include $PREFIX/lib/btllib/python/btllib
directory to make btllib available to the interpreter.import btllib
$PREFIX/bin
directory. Append that path to the PATH
environment variable to make it available to your shell.git clone --recurse-submodules https://github.com/bcgsc/btllib
in order to obtain all the code.btllib
dir, run meson build
to create a build directory.build
dir:
ninja wrap
to regenerate wrappers.ninja test
to build wrappers and tests, and run tests.build
dir:
ninja quality-assurance
to make sure all CI tests pass.sdsl-lite
subproject. Meson config file adjusts the sdsl-lite
config in order for it to work for btllib
, but this is done ad hoc and is not necessary to be committed. By doing it ad hoc we keep a list of differences compared to the upstream repository.build
dir:
ninja docs
to regenerate docs to reflect the release and then commit the changes.meson dist --allow-dirty
to generate a self-contained package based on the last commit. --allow-dirty
permits making a distributable with uncommited changes. This is necessary as sdsl-lite
dependency has ad hoc changes made during the build process. The resulting distributable will be compressed with xz. For easier use, decompress it and then compress with gzip. Attach the resulting file to the release.The following are all the available ninja
commands which can be run within build
directory:
ninja clang-format
formats the whitespace in code (requires clang-format 8+).ninja wrap
wraps C++ code for Python (requires SWIG 4.0+).ninja clang-tidy
runs clang-tidy on C++ code and makes sure it passes (requires clang-tidy 8+).ninja
builds the tests and wrapper libraries / makes sure they compile.ninja test
runs the tests.ninja code-coverage
assures code coverage threshold is satisfied. (requires gcovr 3.3+)ninja sanitize-undefined
runs undefined sanitization.ninja test-wrappers
tests whether wrappers work.ninja docs
generates code documentation from comments (requires Doxygen).ninja quality-assurance
runs clang-format
, wrap
, clang-tidy
, test
, code-coverage
, sanitize-undefined
, and test-wrappers
. These are all checked at the CI test.If you use btllib in your research, please cite:
Nikolić et al., (2022). btllib: A C++ library with Python interface for efficient genomic sequence processing. Journal of Open Source Software, 7(79), 4720, https://doi.org/10.21105/joss.04720
If you use aaHash in your research, please cite:
Wong et al., (2023). aaHash: recursive amino acid sequence hashing. Bioinformatics Advances, vbad162, https://doi.org/10.1093/bioadv/vbad162.