-
Notifications
You must be signed in to change notification settings - Fork 3
Python bindings
Anuradha Wickramarachchi edited this page Mar 28, 2026
·
3 revisions
kmertools exposes Python bindings through the module pykmertools.
The public API is exported from kmertools/conda/src/lib.rs and includes:
OligoComputerCgrComputerKmerGeneratorMinimiserGenerator-
utils(to_numeric,to_acgt)
These bindings are available when you install from:
pip install pykmertoolsconda install -c bioconda kmertools
import pykmertools as kt
from pykmertools import utils as ktutils
print(kt.__doc__)
print(ktutils.to_numeric("ACGTT")) # (111, 27)
print(ktutils.to_acgt(111, 5)) # ACGTT- Detailed API reference: Python bindings reference
- Runnable examples: Python bindings examples
- API-based plotting examples (CGR): Python bindings examples
- DNA alphabet handling is mostly
A/C/G/T/U(case-insensitive). -
CgrComputeris strict and raisesValueErroron invalid bases. -
KmerGenerator,MinimiserGenerator, andOligoComputerskip windows crossing ambiguous bases. -
utils.to_numeric(kmer)currently enforceslen(kmer) <= 32.
kmertools - k-mer driven genomics analytics toolkit