-
Notifications
You must be signed in to change notification settings - Fork 3
Python bindings Examples
Anuradha Wickramarachchi edited this page Mar 28, 2026
·
1 revision
All runnable Python examples are in ./examples/python.
For completeness, this folder includes duplicated FASTA input data in:
Install bindings:
pip install pykmertoolsOr via Bioconda:
conda install -c bioconda kmertoolsRun each script from the repository root.
Script: utils_roundtrip.py
python kmertools.wiki/examples/python/utils_roundtrip.pyShows:
- ACGT string ->
(forward, reverse)numeric tuple - numeric -> ACGT roundtrip
Script: kmer_generator.py
python kmertools.wiki/examples/python/kmer_generator.pyShows:
- iterating
(forward, reverse)integer k-mers - converting iterator output back to strings
- using
kmer_pos_maps()
Script: minimiser_generator.py
python kmertools.wiki/examples/python/minimiser_generator.pyShows:
- iterating
(minimiser, start, end) - mapping minimisers to sequence spans via
seq[start:end] - converting minimiser ints to strings with
to_acgt
Script: oligo_vectors.py
python kmertools.wiki/examples/python/oligo_vectors.pyShows:
-
vectorise_oneandvectorise_batch -
mins=Trueheaders and top features - raw forward-space vectors with
mins=False
Script: cgr_vectors.py
python kmertools.wiki/examples/python/cgr_vectors.pyShows:
- sequence-to-CGR point conversion
- batch CGR conversion
- invalid-base error handling
Script: cgr_api_plots.py
python kmertools.wiki/examples/python/cgr_api_plots.pyInputs:
Outputs:
Simple plot conventions used:
- x-axis and y-axis are always labeled.
- colorbar is labeled for density plot.
kmertools - k-mer driven genomics analytics toolkit