Skip to main content

kmhelpers

License PyPI Bioconda Anaconda Tests DOI

kmhelpers logo

A Python toolkit that automates the lifecycle of kmindex k-mer indexes, from raw sequencing samples to queries. It provides a command-line interface and a matching Python API.

  • Design: discovers samples, counts their k-mers with ntCard, and groups them into sub-indexes with Bloom filters sized to each group.
  • Build: checks files, disk space and memory before building, then builds and merges the sub-indexes with kmindex.
  • Update: adds new samples to an existing index without recounting the samples already indexed.
  • Query: searches FASTA/FASTQ sequences (plain or compressed) and writes TSV, JSON or YAML results with per-sequence and per-sample statistics.
  • Manage: compresses indexes, registers several indexes as one (in development), and runs multi-step workflows from YAML pipeline files.

Documentation: https://sebllns.github.io/kmhelpers/

Installation

Requires Python 3.10 or later on Linux or macOS.

With pip

pip install kmhelpers
kmhelpers install-deps

install-deps downloads the kmtricks, kmindex and ntcard binaries next to the kmhelpers executable, so a virtual environment (python -m venv) is recommended.

With Conda (Bioconda)

conda install -c conda-forge -c bioconda kmhelpers

kmindex and ntcard are installed as dependencies.

Check the installation

kmhelpers --version
kmhelpers check-deps

kh is a short alias for kmhelpers. To install from source, see the installation guide.

Quick start

# 1. Design: list the samples of a directory and compose the index definitions
kmhelpers design /data/sequences -o coli_db/ -n coli

# 2. Build the index from these definitions
kmhelpers build coli_db/compose/coli/*/coli.yaml -o coli_build/

# 3. Query it with FASTA/FASTQ sequences
kmhelpers query -r coli_build/ -o results/ query.fa

The E. coli tutorial walks through these steps on real data, and the command reference lists every option.

Citation

If you use kmhelpers, please cite the archived software:

Bellenous S., Jaron K. S., Peterlongo P. kmhelpers: A Python toolkit for automated management of genomic indexes. Zenodo. https://doi.org/10.5281/zenodo.23730969

A paper is under review at the Journal of Open Source Software.

Disclaimer

kmhelpers is provided "as is", without warranty. Building, updating or compressing an index modifies data in place, so back up important data first, and if you are unsure about an operation, ask here before running it.

License

GNU General Public License v3.0 only, see LICENSE.

Copyright (c) 2026 Sébastien Bellenous, Genscale, INRIA

Contact

Acknowledgements

The authors thank Téo Lemane for developing kmindex and for his responsiveness in addressing feature requests and issues raised during the development of kmhelpers. We acknowledge the GenOuest core facility (https://www.genouest.org) for providing the computing infrastructure. The work was funded by the Inria Challenge "OmicFinder" (https://project.inria.fr/omicfinder/), and by the state funding managed by the French National Research Agency under the France 2030 program [ANR-22-PEAE-0005].

Metadata

Release files for kmhelpers 0.7.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kmhelpers 0.7.4
File Size Uploaded Provenance Actions
kmhelpers-0.7.4.tar.gz 186.0 kB With provenance Details for kmhelpers-0.7.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kmhelpers 0.7.4
File Interpreter ABI Platform Actions
kmhelpers-0.7.4-py3-none-any.whl Python 3 none any Details for kmhelpers-0.7.4-py3-none-any.whl

Total release size: 410.1 kB

Release files / kmhelpers-0.7.4.tar.gz

Download URL kmhelpers-0.7.4.tar.gz
Size 186.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c5f827ebc6a95df17da5f9ab8549a9a5108c386a23582c2f2127f26a4e3c77b7
BLAKE2b-256 checksum
How to use checksums
201213ee5785f3867a4e87bcd8d3b3a24f2e428c62a4b9b1df83b9d3b125a56a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

Release files / kmhelpers-0.7.4-py3-none-any.whl

Download URL kmhelpers-0.7.4-py3-none-any.whl
Size 224.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3c59bedac860b72dc2984d3ab734d565bf4506e9ac088f2cccd5db8749f66672
BLAKE2b-256 checksum
How to use checksums
d2d88946c259e16b5d22c02647b57dfcb9d2112e8d1bcae139689dfe88ed67bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

Security for kmhelpers 0.7.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for kmhelpers-0.7.4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.7.4 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page