wormbench
Grade simulated or real Caenorhabditis elegans tracks against real-worm behaviour.
wormbench reads 1-s positions and grades a population on standard assays:
- Scheer & Bargmann's small lawn: roaming fraction, roaming and dwelling bout lengths, lawn exits per on-lawn hour, roaming enrichment before an exit, and time on the lawn;
- Scheer & Bargmann's uniform well: roaming fraction and both bout lengths;
- kinematics on the lawn: 10-s window speeds while dwelling and roaming, and roaming-bout survival;
- activity on the lawn: the pause share, the direction-flip fraction and the reversal-onset rate;
- López-Cruz et al.'s local search after food removal: its decay rate and early/late ratio.
Each statistic is graded against a band built from the spread between real recording dates, at the population's own size. A population passes a statistic when its z lies within the benchmark's Bonferroni bar, and it passes the wild type when every family passes. Two distances summarise the grading: D over every family and D_fit over the families a fit reads. A mutant is graded on its difference from its own wild type.
It depends on numpy and scipy only, on Python 3.10 or later.
Install
pip install wormbench
A first grading
The package ships 64 real wild-type animals on the small lawn, so a grading runs with no download:
wormbench example --out example
wormbench grade --manifest example/manifest.txt --out example/grade.json
These animals come from the recording dates the bands are built from, so the example shows how the grader reads tracks and validates nothing.
Your own tracks
A manifest lists one file per line, as <family> <file>, with family one of small_lawn,
uniform_lawn or local_search. Each animal in a file is one member of its family's population.
Relative files are read against the manifest's directory.
CSV, with a sidecar <file>.json:
- columns
animal,t_s,x,y, and an optionalon_lawn(0 or 1); - the sidecar names the
family, theanalysis_start_sat which the family's window begins, theunits(mm,um, or in a CSV pixels withmm_per_px) and thelawn. A lawn is{"centre": [x, y], "radius": r},{"centre": [x, y], "radii": [...]}at equally spaced angles from +x, or"uniform".
WCON 1.0: its core (units, data), with the same metadata in a top-level
@nematode_benchmark object. Records sharing an id are merged in time order. A skeleton is reduced
to its middle point, and null is a missing sample.
Each track is resampled to 1 s and cut to its family's window: the small lawn's and the uniform well's last 40 minutes, and local search's 45 minutes from food removal.
Writing WCON
wormbench wcon writes a CSV's tracks, with its sidecar, as one WCON 1.0 file in mm and s. It then
reads the file back, and writes the output only if every sample and the metadata are unchanged, so
the WCON file grades as the CSV does:
wormbench wcon --tracks tracks.csv --out tracks.wcon [--simulated]
--simulated carries each animal's primitive labels and seed as @primitive and @seed. WCON's
core has no on-lawn flag, so a lawn family's file whose membership comes from an on_lawn column is
refused: drop the column and give the lawn's boundary, or "uniform", in the sidecar instead. From Python,
wormbench.track_export.write_wcon and write_csv write a list of tracks as
wormbench.track_import reads them.
Simulated tracks
A real tracker loses and blurs a worm's position; a simulator does not. To grade a simulated worm the
way the benchmark grades its own, pass --simulated. Each animal on Scheer's rig is then measured
first: tracker noise resampled from real paused worms, and lost seconds.
wormbench grade --manifest sim.txt --out sim.json --simulated
That needs each second's primitive (run, reversal, omega or delta) and one integer seed per
animal: primitive and seed CSV columns, or a WCON record's @primitive (one per time) and
@seed. A simulated track must be sampled every second. A seed used twice is refused, since two
animals would draw the same noise. Local search is never measured.
What is not graded for imported tracks
Chemotaxis is graded on Chen et al.'s measured butanone field, which an imported track does not carry, so an imported population is graded on the other families, and its D is undefined.
Versions
--bands v1|v2|v3|v4 picks the benchmark's version. Every 1.x release grades on v4 by default;
only a major release changes the default. v1 to v3 are frozen, so a past grading can be reproduced.
Every grading records the package version, the bands version and the bands' SHA-256.
Data
The bands, the classifier, the tracker-noise library and the local-search reference ship inside the package. Grading at a population size with no vendored bands (anything but 64 or 200 animals) rebuilds the bands from the real tracks, which are fetched once:
wormbench data fetch
wormbench data verify
The tracks are deposited on Zenodo as the package's reference data, version 1
(doi:10.5281/zenodo.24585652, about 37 MB). wormbench data fetch
downloads them from that record, resuming a transfer the server cuts short, and checks each file
against its SHA-256. WORMBENCH_DATA can instead point at a directory holding the files, laid out
as benchmark/<file>. The example in A first grading needs no download.
Nothing is downloaded otherwise. Every file read from WORMBENCH_DATA, the package or the fetched
cache is checked against the SHA-256 the package records. A program that sets its own data root
(as the project this package comes from does for its repository's data/) has those files read as
given. wormbench info shows where each file is read from.
Citation
Cite the package (see CITATION.cff) and the data it grades against:
- Scheer, E. & Bargmann, C. I. (2023). eLife 12:RP88657. Dryad doi:10.5061/dryad.47d7wm3jf.
- López-Cruz, A., et al. (2019). Neuron 102:407–419. Mendeley Data doi:10.17632/prdtw5jgcd.1.
- Chen, K. S., et al. (2025). PLoS Biology, doi:10.1371/journal.pbio.3003005.
- Calhoun, A. J., et al. (2014). eLife 3:e04220; Roberts, W. M., et al. (2016). eLife 5:e12572.
- The derived files as this package fetches them: Zaharia, C. J. (2026). Real-worm reference data for wormbench, version 1. Zenodo. doi:10.5281/zenodo.24585652.
Licence
The code is licensed under Apache-2.0. The reference data keep their deposits' licences, CC0-1.0
and CC BY 4.0; see NOTICE and each data namespace's PROVENANCE.md.
Metadata
Release files for wormbench 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| wormbench-1.0.1.tar.gz | 1.3 MB | With provenance | Details for wormbench-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| wormbench-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for wormbench-1.0.1-py3-none-any.whl |
Total release size: 2.7 MB
Release files / wormbench-1.0.1.tar.gz
| Download URL | wormbench-1.0.1.tar.gz |
|---|---|
| Size | 1.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
91a0bd0f1231a72885286ac57440b82d5e399e40f2b589e320fc6150fd48d498
|
|
BLAKE2b-256 checksum How to use checksums |
ca85f9781e71c9bde10d4075170dd87c6f12327a561e2068b9755720bed308d5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.
Transparency logRelease files / wormbench-1.0.1-py3-none-any.whl
| Download URL | wormbench-1.0.1-py3-none-any.whl |
|---|---|
| Size | 1.4 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
43ea679441a0564d534c0599f2aa65ce8181983c9180186e82e7040e45c603c5
|
|
BLAKE2b-256 checksum How to use checksums |
088bbae470345646eff22d893880c7e5203a4757ee1bf99ce03f39269e87c7f6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.
Transparency logSecurity for wormbench 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for wormbench-1.0.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.