Sequence-to-function training data, straight from BAM.
A quadrat is the fixed-size frame a field ecologist drops on the ground to tally everything inside it, moved across a landscape by a sampling design chosen separately from the frame. This package is that: a fixed-length window, placed at loci by a sampling scheme, tallying the positions that fall inside.
Everything between a set of alignments and a batch of (sequence, signal) pairs is independent of the model that consumes them. quadrat implements that span — the pileup, the window cache, the sampler and the loader — so any sequence-to-function architecture can be trained without reimplementing it.
Under construction. The data path is being extracted from cherimoya; see #1 for the specification and the slices it lands in.
Nothing is published yet. Once the data path lands, the two installs will be:
pip install quadrat # verify and inspect tracks
pip install "quadrat[pileup]" # also build them from alignmentsThe pileup extra is the engine: polars-bio, which reads alignments, and giql, which transpiles interval joins. Whatever reads alignments or joins intervals needs it, and building tracks from alignments does both; reading a track that already exists does neither.
The base install is for a track that already exists: it verifies one, lists the contigs it holds, and reads the record it was written with. That is enough to inspect a corpus someone else piled up, and it is the install quadrat's package docstring states the import guarantee about.
The extra resolves with uv and not yet with pip, because one of its dependencies is pinned to a git revision that only uv reads — the comment on [tool.uv.sources] in pyproject.toml says why and when that changes.
uv sync --locked --all-extras # install, pileup engine included
uv run pytest -q # run the suite
uv run ruff format --check src tests build-hooks # check formatting
uv run ruff check src tests build-hooks # lintThe version is the repository's rather than a literal in the tree: a vMAJOR.MINOR.PATCH tag names a release, and a commit between tags reports the last release plus the commit it is, so releasing is pushing a tag and nothing in the tree changes for one. A build from a tree that is not a checkout — an unpacked source distribution — reports the version that distribution was built with.
uv sync --locked --no-dev installs what pip install quadrat will, which is the base install the import guarantee above is about; CI runs it as a job of its own.
MIT.