How martiniani-lab/sweetsourcod works
SweetSourCod is a source-coding library for estimating sequence entropy and complexity through compression and parsing. Users supply sequences to its Python-facing algorithm modules and obtain measures or compressed representations. Its documented capabilities include LZ77/LZ78 and cross-parsing, block entropy and BWT-based estimation, general-purpose compressors and run-length encoding, and Hilbert/Gosper space-filling curves. The sampled C++ code shows LZ77 and BWT relying on suffix-array routines; unsampled Python extension internals limit detail on how all documented algorithms are exposed.
Main entry points: lempel_ziv.hpp LZ algorithms · kkp.cpp KKP parsing · divsufsort.c Suffix sorting · block_sorting.hpp BWT core
Components 16
Parsing and complexity
- Lempel-Ziv
sweetsourcod/lempel_ziv.pyx - LZ algorithms
source/sweetsourcod/lempel_ziv.hpp - KKP parsing
source/kkp.cpp - KKP interfaces
source/kkp/kkp.h - SA streamer
source/kkp/SA_streamer.h - Suffix sorting
source/divsufsort.c - Suffix API
source/kkp/divsufsort.h
Entropy estimators
- Block entropy
sweetsourcod/block_entropy.pyx - Block entropy core
source/sweetsourcod/block_entropy.hpp - BWT estimator
sweetsourcod/block_sorting.pyx - BWT core
source/sweetsourcod/block_sorting.hpp
Compression utilities
- Compression and RLE
sweetsourcod/zipper_compress.py - Sequence utilities
sweetsourcod/utils.py
Space-filling curves
- Hilbert curve
sweetsourcod/hilbert.pyx - Gosper curve
sweetsourcod/gosper.pyx
Other components
- Python user
Connections 15
- Python user → Lempel-Ziv: uses
README.md - Python user → Block entropy: uses
README.md - Python user → BWT estimator: uses
README.md - Python user → Compression and RLE: uses
README.md - Python user → Hilbert curve: uses
README.md - Python user → Gosper curve: uses
README.md - LZ algorithms → KKP parsing: calls
source/sweetsourcod/lempel_ziv.hpp - LZ algorithms → Suffix sorting: builds suffix array
source/sweetsourcod/lempel_ziv.hpp - KKP parsing → SA streamer: reads array file
source/kkp.cpp - KKP parsing → KKP interfaces: implements
source/kkp.cpp - Suffix sorting → Suffix API: implements
source/divsufsort.c - Block entropy core → LZ algorithms: uses conversions
source/sweetsourcod/block_entropy.hpp - BWT core → Suffix sorting: computes transform
source/sweetsourcod/block_sorting.hpp - BWT core → LZ algorithms: uses conversions
source/sweetsourcod/block_sorting.hpp - Compression and RLE → Sequence utilities: uses byte helpers
sweetsourcod/zipper_compress.py