Skip to content

Commit 8131e91

Browse files
committed
release: add CHANGELOG, RELEASING runbook, and readthedocs config
Adds the supporting files that the avitai sibling repos use around their publish workflow: - .readthedocs.yaml: ubuntu-22.04 + Python 3.11 build, mkdocs-material install, mkdocs.yml as configuration source, [docs] extras for the project install. Mirrors the opifex setup so docs.avitai.bio / ReadTheDocs hosting behave consistently. - CHANGELOG.md: Keep a Changelog format with the 0.1.0 entry describing the initial public release surface (40+ operators, 6 pipelines, soft ops, sources, splitters, losses, training, docs, benchmarks, CI/CD). - RELEASING.md: step-by-step runbook for the next maintainer release — bump version, update changelog, run the local checks (pytest, pre-commit, mkdocs build --strict, uv build, twine check), tag, push, and run the publish workflow with target=github-release. Documents the PYPI_API_TOKEN / TEST_PYPI_API_TOKEN repo-secret requirements.
1 parent 96af8ad commit 8131e91

6 files changed

Lines changed: 218 additions & 34 deletions

File tree

.readthedocs.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Read the Docs configuration file
2+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3+
4+
version: 2
5+
6+
build:
7+
os: ubuntu-22.04
8+
tools:
9+
python: "3.11"
10+
jobs:
11+
post_install:
12+
- pip install mkdocs-material
13+
14+
mkdocs:
15+
configuration: mkdocs.yml
16+
fail_on_warning: false
17+
18+
python:
19+
install:
20+
- method: pip
21+
path: .
22+
extra_requirements:
23+
- docs

CHANGELOG.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Changelog
2+
3+
All notable changes to DiffBio will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
## [0.1.0] - 2026-05-02
11+
12+
Initial public release of DiffBio: end-to-end differentiable bioinformatics
13+
pipelines built on JAX, Flax NNX, and the Datarax / Artifex / Opifex /
14+
Calibrax ecosystem.
15+
16+
### Added
17+
18+
- 40+ differentiable operators across alignment, variant calling, single-cell
19+
analysis, drug discovery, epigenomics, multi-omics, RNA structure, protein
20+
structure, molecular dynamics, foundation models, and preprocessing.
21+
- Six end-to-end pipelines: `VariantCallingPipeline`,
22+
`EnhancedVariantCallingPipeline`, `SingleCellPipeline`,
23+
`DifferentialExpressionPipeline`, `PerturbationPipeline`, and
24+
`PreprocessingPipeline`.
25+
- Soft-operations primitive layer (`diffbio.core.soft_ops`) with
26+
straight-through and gradient-replacement variants for use inside
27+
differentiable bioinformatics workflows.
28+
- Dataset sources for FASTA, BAM, AnnData, MoleculeNet, and indexed views.
29+
- Dataset splitters for random, stratified, scaffold, Tanimoto cluster, and
30+
sequence-identity splits.
31+
- Loss functions for alignment, biological regularization, single-cell
32+
analysis, statistical models, and metric learning.
33+
- Training utilities (`Trainer`, `TrainingConfig`, optimizer factories,
34+
synthetic data generation, gradient clipping).
35+
- Documentation site: getting-started guides, user-guide, API reference,
36+
examples (basic / intermediate / advanced), and contributor guides.
37+
- Benchmark suite under `benchmarks/` with tier-based runner
38+
(`run_all.py --tier ci|nightly|full`) and SOTA baseline comparisons across
39+
single-cell, alignment, RNA structure, protein, molecular dynamics, and
40+
statistical domains.
41+
- CI/CD: sharded unit tests with `pytest-xdist`, integration / e2e /
42+
performance jobs, coverage aggregation, security scanning, build
43+
verification, and documentation deployment workflows.

README.md

Lines changed: 57 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ This enables learning optimal pipeline parameters directly from data, rather tha
4848
- **Composable Architecture** built on the Datarax, Artifex, Opifex, and Calibrax stack
4949
- **Training Utilities** with gradient clipping, custom loss functions, and synthetic data generation
5050

51-
For complete operator and pipeline listings, see the [Operators Overview](https://docs.avitai.bio/diffbio/user-guide/operators/overview/) and [Pipelines Overview](https://docs.avitai.bio/diffbio/user-guide/pipelines/overview/) in the documentation.
51+
For complete operator and pipeline listings, see the [Operators Overview](https://diffbio.readthedocs.io/en/latest/user-guide/operators/overview/) and [Pipelines Overview](https://diffbio.readthedocs.io/en/latest/user-guide/pipelines/overview/) in the documentation.
5252

5353
## Installation
5454

@@ -70,24 +70,22 @@ import jax
7070
import jax.numpy as jnp
7171
from flax import nnx
7272

73-
from diffbio.operators import DifferentiableQualityFilter
74-
from diffbio.operators.variant.pileup import DifferentiablePileup
75-
from diffbio.operators.alignment.smith_waterman import SmoothSmithWaterman
73+
from diffbio.operators import DifferentiableQualityFilter, QualityFilterConfig
7674

77-
# Quality filtering with learnable threshold
75+
# Quality filtering with learnable threshold (default initial_threshold=20.0)
7876
quality_filter = DifferentiableQualityFilter(
79-
threshold=20.0,
80-
temperature=1.0,
77+
QualityFilterConfig(initial_threshold=20.0),
8178
rngs=nnx.Rngs(0),
8279
)
8380

84-
# Apply to reads
81+
# Apply to a one-hot encoded sequence with per-position quality scores
8582
quality_scores = jnp.array([35.0, 15.0, 28.0, 10.0])
86-
reads = jax.nn.one_hot(jnp.array([[0, 1, 2, 3]] * 4), 4)
87-
data = {"reads": reads, "quality": quality_scores}
83+
sequence = jax.nn.one_hot(jnp.array([0, 1, 2, 3]), 4) # (length, alphabet=4)
84+
data = {"sequence": sequence, "quality_scores": quality_scores}
8885

8986
filtered_data, _, _ = quality_filter.apply(data, {}, None)
90-
# filtered_data["weights"] contains soft weights for each read
87+
# filtered_data["sequence"] — sequence with low-quality positions softly suppressed
88+
# filtered_data["quality_scores"] — pass-through quality values
9189
```
9290

9391
### Using the Variant Calling Pipeline
@@ -178,7 +176,10 @@ DiffBio sits on a layered ecosystem rather than standing alone:
178176
| Modeling substrate | [Artifex](https://github.com/avitai/artifex) | Reusable transformer and generative-model components |
179177
| Scientific ML substrate | [Opifex](https://github.com/avitai/Opifex) | Scientific optimization, operator learning, and advanced training methods |
180178
| Evaluation substrate | [Calibrax](https://github.com/avitai/calibrax) | Metrics, benchmarking, comparison, profiling, and regression checks |
181-
| Biology-specific layer | DiffBio | Differentiable biological operators and domain compositions |
179+
180+
DiffBio itself sits on top of these as the biology-specific layer: differentiable
181+
biological operators and end-to-end pipeline compositions (alignment, variant
182+
calling, single-cell analysis, drug discovery, structural biology, multi-omics).
182183

183184
Each DiffBio operator inherits from Datarax's `OperatorModule` and implements:
184185

@@ -193,18 +194,31 @@ This enables:
193194

194195
### Operator Composition
195196

196-
Operators are chained by threading the `(data, state, metadata)` triple
197-
returned by `apply()` into the next operator:
197+
`apply()` runs an operator on a single element (no batch dimension). Operators
198+
are chained by threading the `(data, state, metadata)` triple returned by
199+
`apply()` into the next operator:
198200

199201
```python
200-
data, state, metadata = quality_filter.apply(batch_data, {}, None)
202+
data, state, metadata = quality_filter.apply(element_data, {}, None)
201203
data, state, metadata = pileup.apply(data, state, metadata)
202204
data, state, metadata = classifier.apply(data, state, metadata)
203205

204206
# `data` is a dict of JAX arrays — read out the per-position predictions
205207
predictions = data["logits"]
206208
```
207209

210+
For batched data wrapped in a Datarax `Batch`, call the operator directly
211+
(or use `apply_batch()`); both delegate to the same code path:
212+
213+
```python
214+
from datarax import Batch
215+
216+
batch = Batch.from_parts(...) # construct from a list of elements
217+
batch = quality_filter(batch) # equivalent to quality_filter.apply_batch(batch)
218+
batch = pileup(batch)
219+
batch = classifier(batch)
220+
```
221+
208222
## Testing
209223

210224
```bash
@@ -225,24 +239,38 @@ uv run pytest tests/integration/ -vv
225239
```
226240
DiffBio/
227241
├── src/diffbio/
228-
│ ├── core/ # Base operators, graph utils, soft ops
229-
│ ├── operators/ # 35+ differentiable operators
242+
│ ├── core/ # Base operators, graph utils, soft ops, neural components
243+
│ ├── operators/ # 40+ differentiable operators
230244
│ │ ├── alignment/ # Smith-Waterman, profile HMM, soft MSA
231-
│ │ ├── variant/ # Pileup, classifiers, CNV segmentation
232-
│ │ ├── singlecell/ # Clustering, trajectory, velocity, GRN, ...
233-
│ │ ├── drug_discovery/ # Fingerprints, property prediction, ADMET
234-
│ │ ├── epigenomics/ # Peak calling, chromatin state
235-
│ │ ├── normalization/ # VAE normalizer, UMAP, PHATE
245+
│ │ ├── assembly/ # GNN assembly, metagenomic binning
246+
│ │ ├── crispr/ # Guide RNA scoring
247+
│ │ ├── drug_discovery/ # Fingerprints, ADMET, AttentiveFP, MACCS keys
248+
│ │ ├── epigenomics/ # Peak calling, chromatin state, contextual epigenomics
249+
│ │ ├── foundation_models/ # Geneformer/scGPT adapters, transformer encoders
250+
│ │ ├── mapping/ # Neural read mapping
251+
│ │ ├── metabolomics/ # Spectral similarity
252+
│ │ ├── molecular_dynamics/ # Force fields, MD integrators
253+
│ │ ├── multiomics/ # Hi-C, spatial deconvolution, multi-omics VAE
254+
│ │ ├── normalization/ # VAE normalizer, UMAP, PHATE, embeddings
255+
│ │ ├── population/ # Ancestry estimation
256+
│ │ ├── preprocessing/ # Adapter removal, duplicate weighting, error correction
257+
│ │ ├── protein/ # Secondary structure
258+
│ │ ├── rna_structure/ # RNA folding
259+
│ │ ├── rnaseq/ # Splicing PSI, motif discovery
260+
│ │ ├── singlecell/ # Clustering, trajectory, velocity, GRN, batch correction, ...
236261
│ │ ├── statistical/ # HMM, NB GLM, EM quantification
237-
│ │ ├── multiomics/ # Hi-C, spatial deconvolution
238-
│ │ └── ... # preprocessing, protein, RNA, assembly, ...
239-
│ ├── pipelines/ # End-to-end pipelines
240-
│ ├── losses/ # Alignment, single-cell, statistical losses
241-
│ ├── sources/ # Data loaders (FASTA, BAM, MolNet, ...)
242-
│ ├── splitters/ # Dataset splitting strategies
243-
│ └── utils/ # Training utilities
262+
│ │ └── variant/ # Pileup, classifiers, CNV segmentation
263+
│ ├── pipelines/ # 6 end-to-end pipelines
264+
│ ├── losses/ # Alignment, biological-regularization, single-cell, statistical, metric
265+
│ ├── sources/ # Data loaders (FASTA, BAM, AnnData, MoleculeNet, indexed views)
266+
│ ├── splitters/ # Random, stratified, scaffold, Tanimoto, sequence-identity
267+
│ ├── samplers/ # Perturbation samplers
268+
│ ├── sequences/ # DNA / RNA encoding utilities
269+
│ ├── evaluation/ # Evaluation runner and graders
270+
│ └── utils/ # Training utilities, dependency-runtime checks
244271
├── tests/ # Unit, integration, and benchmark tests
245272
├── benchmarks/ # Domain benchmarks with training + baselines
273+
├── examples/ # Runnable example scripts paired with notebooks
246274
└── docs/ # MkDocs documentation
247275
```
248276

@@ -262,7 +290,6 @@ MIT License. See [LICENSE](LICENSE) for details.
262290
## Acknowledgments
263291

264292
DiffBio builds on ideas from:
265-
- [SMURF](https://www.biorxiv.org/content/10.1101/2021.10.23.465204): Differentiable Smith-Waterman for end-to-end MSA learning
266293
- [Datarax](https://github.com/avitai/datarax): Composable data processing framework
267294
- [Artifex](https://github.com/avitai/artifex): Generative-model and transformer substrate
268295
- [Opifex](https://github.com/avitai/Opifex): Scientific ML and advanced optimization substrate

RELEASING.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# Releasing DiffBio
2+
3+
DiffBio publishes through `.github/workflows/publish.yml`.
4+
No commit or tag push creates a release by itself. Release timing and versioning
5+
stay under operator control. The manual `target=github-release` workflow path
6+
creates a GitHub Release for an explicit existing tag with
7+
`softprops/action-gh-release@v2` and `generate_release_notes: true`, then
8+
publishes to PyPI. Publishing an existing GitHub Release also runs the PyPI
9+
upload path.
10+
11+
## Release Checklist
12+
13+
1. Activate the local environment.
14+
15+
```bash
16+
source activate.sh
17+
```
18+
19+
2. Bump the package version in `pyproject.toml` (the static `version = "X.Y.Z"`
20+
field under `[project]`).
21+
3. Update `CHANGELOG.md` by moving unreleased entries under the new version and
22+
date.
23+
4. Run the release checks.
24+
25+
```bash
26+
uv run pytest
27+
uv run pre-commit run --all-files
28+
uv run mkdocs build --strict --clean
29+
rm -rf dist/
30+
uv build
31+
uv run twine check dist/*
32+
```
33+
34+
5. Commit the version and changelog updates.
35+
6. Create and push an annotated tag from the exact release commit.
36+
37+
```bash
38+
target_sha=$(git rev-parse HEAD)
39+
git tag -a vX.Y.Z -m "diffbio X.Y.Z"
40+
git push origin main vX.Y.Z
41+
```
42+
43+
7. In GitHub Actions, manually run `Publish to PyPI` with:
44+
45+
- `target=github-release`
46+
- `version_tag=vX.Y.Z`
47+
48+
The workflow verifies that the tag exists, creates the GitHub Release with
49+
generated release notes, then publishes to PyPI.
50+
51+
## Manual Release Recovery
52+
53+
If the manual generated-release workflow is interrupted before creating the
54+
GitHub Release, use GitHub generated notes manually from the exact tagged
55+
commit.
56+
57+
```bash
58+
gh release create vX.Y.Z --target "$target_sha" --generate-notes
59+
```
60+
61+
Publishing that release triggers the same PyPI upload workflow.
62+
63+
## TestPyPI
64+
65+
Use the manual `workflow_dispatch` path in `publish.yml` with `target=testpypi`
66+
when validating publishing setup before a real release.
67+
68+
## PyPI Authentication
69+
70+
The publish workflow uses API token authentication. Two repo secrets must be
71+
set on `avitai/DiffBio`:
72+
73+
- `PYPI_API_TOKEN` — account-scoped token used by the `pypi` job
74+
- `TEST_PYPI_API_TOKEN` — account-scoped token used by the `testpypi` job
75+
76+
For the maiden release of a new project, the token must be **account-scoped**
77+
(project-scoped tokens cannot create new projects). Once the project exists on
78+
PyPI, project-scoped tokens are preferred for least-privilege rotation.
79+
80+
To migrate to OIDC trusted publishing later, register the project at
81+
<https://pypi.org/manage/account/publishing/> (and the TestPyPI equivalent)
82+
with:
83+
84+
- Owner: `avitai`
85+
- Repository: `DiffBio`
86+
- Workflow: `publish.yml`
87+
- Environment: `pypi` (and `testpypi`)
88+
89+
Then remove the `password` inputs from the publish steps and add
90+
`permissions: id-token: write` to each publish job.

docs/index.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,12 @@ Traditional bioinformatics pipelines consist of discrete, non-differentiable ope
162162
If you use DiffBio in your research, please cite:
163163

164164
```bibtex
165-
@software{diffbio2024,
165+
@software{diffbio2026,
166166
title={DiffBio: End-to-End Differentiable Bioinformatics Pipelines},
167167
author={Shafiei, Mahdi},
168-
year={2024},
169-
url={https://github.com/avitai/DiffBio}
168+
year={2026},
169+
url={https://github.com/avitai/DiffBio},
170+
version={0.1.0}
170171
}
171172
```
172173

mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
site_name: DiffBio
22
site_description: End-to-end differentiable bioinformatics pipelines built on JAX/Flax NNX, Datarax, Artifex, Opifex, and Calibrax
33
site_author: Mahdi Shafiei
4-
site_url: https://docs.avitai.bio/diffbio
4+
site_url: https://diffbio.readthedocs.io/en/latest/
55
repo_url: https://github.com/avitai/DiffBio
66
repo_name: avitai/DiffBio
77
edit_uri: edit/main/docs/

0 commit comments

Comments
 (0)