Developer guide#
BASALT is a command-line workflow rather than a stable importable Python API. Internal functions, filenames, argument lists, and intermediate formats may change without deprecation. External software should invoke a pinned BASALT command and treat documented files as workflow outputs.
Entry points#
File |
Responsibility |
|---|---|
|
Parse the CLI and dispatch normal, data-feeding, refinement, and dereplication routes |
|
Orchestrate the default CheckM2 workflow |
|
Legacy CheckM orchestration |
|
Normalize external binsets and generate compatible mapping and quality inputs |
Pipeline modules#
Stage |
CheckM2 implementation |
Legacy CheckM implementation |
|---|---|---|
Candidate generation |
|
shared |
Optional binners |
|
shared |
Coverage and connectivity |
|
|
Within-assembly selection |
|
|
Cross-assembly selection |
|
|
Contig screening |
|
|
PE-supported retrieval |
|
|
Additional retrieval |
|
|
Long-read retrieval and polishing |
|
|
OLC |
|
|
Reassembly |
|
matching |
Final OLC |
|
|
Model components#
File |
Responsibility |
|---|---|
|
Multilayer-perceptron and residual-block definitions |
|
Load model descriptors and combine predictions |
|
PyTorch dataset wrappers for contig features |
|
Training and evaluation utilities |
|
Canonical downloader installed as |
The trained model files are external assets. Code version alone is insufficient to reproduce model-based refinement.
Development constraints#
Many modules execute work at the filesystem and process level.
Several commands are assembled as shell strings, so filenames require conservative handling.
Intermediate filenames are part of checkpoint coordination.
Broad exception handlers and shell exit-code handling can obscure failures.
Dated module filenames are historical identifiers, not semantic versions.
Changes to intermediate naming, checkpoint text, or contig identifiers can break continuation and downstream stages. Test full and resumed workflows when modifying them.
Documentation build#
Documentation sources are under BASALT_Guide/docs/ and use Sphinx with the Sphinx Book Theme and MyST Markdown.
python -m venv .venv-docs
. .venv-docs/bin/activate
python -m pip install -r BASALT_Guide/requirements.txt
sphinx-build -W --keep-going -b html \
BASALT_Guide/docs .build/basalt-guide
Preview the completed build locally:
python -m http.server 8000 \
--bind 127.0.0.1 \
--directory .build/basalt-guide
Then open http://127.0.0.1:8000/. Rebuild and reload the page after editing a source file.
Read the Docs uses the repository-root .readthedocs.yaml. A local warnings-as-errors build should pass before documentation changes are merged.
Contribution checklist#
Keep CLI defaults synchronized between
BASALT.py, the README, andusage.md.Add a bounded test or demo case for changed workflow behavior.
Preserve or explicitly migrate checkpoint semantics.
Document required external-tool and database versions.
Run a strict documentation build.
Report limitations and failure modes with the feature description.