Matched handoff
Transpose and reorder preserve the labeled counts and typed metadata. Both checks exit 0.
Follow five synthetic observations from AnnData to R. Check typed metadata, every sparse count, and whether a consumer can safely attach metadata in row order.
The ZIP includes native objects, ordered axis files, all six receipts, and scripts to regenerate the fixture.
702860128cdece0da6a600b7459eea3681316213abc2e827b51d315817562393
Download checksum file
Compare each export with its source. Both preserve the same IDs and count totals. Then change how the original metadata attaches to the reordered matrix. The replay uses the archived synthetic example.
Read the four count changes and the metadata binding result in the worked example below.
Compare counts by both IDs. Totals alone miss changes that cancel out.
| Matrix ID | Metadata ID | Result |
|---|
Check the binding rule used by the next step, even when both exports contain the same IDs.
Read the export receiptsRead the binding receiptsRun the checks yourself
The source has three features and five observations. The Python writer creates a native AnnData object and a separate Matrix Market bundle. R builds typed candidates, reorders both axes, then writes each sparse bundle with observations in rows. Each metadata receipt records one expected observation reorder under the supplied policy.
Transpose and reorder preserve the labeled counts and typed metadata. Both checks exit 0.
Donor codes become integers. At O-B, "001" becomes 1. The metadata check finds one type change and five value changes. Counts agree.
Four counts change while the typed metadata, every row and column total, and the nonzero count agree.
The count receipt aligns values by feature and observation ID. Here, each gain is balanced by a loss in both directions. Every other count stays the same.
| Feature | O-B | O-D | Row total |
|---|---|---|---|
001 | 1 → 2 | 6 → 5 | 7 → 7 |
F-001 | 5 → 4 | 2 → 3 | 7 → 7 |
| Column total | 6 → 6 | 8 → 8 |
The matched export passes both comparisons above. If a downstream step attaches the original metadata by row position, all five rows attach to the wrong observations. The first metadata row describes O-B, while the first observation in the exported matrix is O-A.
With CellMeta Receipt v0.2.0, give check-axis the exact metadata and observation files that the downstream step will consume. Run these commands inside the extracted example folder.
cellmeta-receipt check-axis examples/baseline/metadata.json examples/matched/observations.tsv --binding keyed
cellmeta-receipt check-axis examples/baseline/metadata.json examples/matched/observations.tsv --binding positional
A join by literal ID is compatible and exits 0. Positional assignment exits 1 and shows the first mismatch. The command checks the declared binding and leaves both files as supplied.
If the workflow requires positional input and both files contain the same complete set of IDs, use CellMeta Receipt v0.3.0 to write a new snapshot in the matrix's observation order. Keep the original snapshot for provenance.
cellmeta-receipt align-axis examples/baseline/metadata.json examples/matched/observations.tsv --output aligned-metadata.json
cellmeta-receipt check-axis aligned-metadata.json examples/matched/observations.tsv --binding positional --counts-only
Both commands exit 0 for this example. The new snapshot carries the same typed values and category declarations, and the matrix stays intact. A roster mismatch stops alignment before writing any output.
Install CellMeta Receipt v0.2.0 from its wheel and put the Counts Matrix Receipt v0.2.0 executable on your path. After extracting the example, run these commands inside the single-cell-handoff folder.
cellmeta-receipt check examples/baseline/metadata.json examples/matched/metadata.json --policy examples/allow-row-reorder.json
counts-matrix-receipt compare --baseline examples/baseline/bundle.json --candidate examples/matched/bundle.json --format json
Repeat with metadata-drift and then counts-drift in place of matched. Exit 1 reports a comparison with findings. Exit 2 means invalid input or an execution error. A workflow that requires both to agree should proceed only when both commands exit 0.
The workflow verifies the SHA-256 of CellMeta Receipt v0.2.0 and Counts Matrix Receipt v0.2.0 before running them. It requires the reviewed exit pairs (0, 0), (1, 0), and (0, 1), plus the expected keyed pass and positional failure.
A successful run on main saves eight reviewed synthetic JSON receipts. Pull requests run the checks without uploading receipts.
Run the metadata and count checks on the same export pair, with an optional keyed or positional observation check. The starter saves valid receipts and check statuses before returning the combined exit code.
The standalone skill checks typed metadata, labelled counts, and the observation binding separately. Use the synthetic example first, then pass it the files your own workflow consumes.
The Workflow RO-Crate bundles runnable source, setup commands, synthetic exports, and expected receipts. The workflow saves both check results before applying the gate. The matched export exits 0. Metadata drift and count drift each exit 1. A missing candidate matrix exits 2 and leaves the metadata receipt available.
All four cases passed end to end on hosted Linux x86-64 using Nextflow 26.10.7, Java 21.0.13.1+2, Python 3.12, CellMeta Receipt 0.2.0, and Counts Matrix Receipt 0.3.0. On native Windows with Python 3.14.0, Nextflow lint and the task replays passed. The full Nextflow session stopped before either task started with Unknown signal: HUP.
The Process Run RO-Crate contains the exact synthetic exports, both observed receipts, tool versions, UTC timings, and checksums. The metadata check exited 0 and the count check exited 1 after finding four changed coordinates. Both checks produced valid results.
The verified run used Python 3.14.0, AnnData 0.13.3.post0 and SciPy 1.17.1 to write the source. R 4.6.1, Matrix 1.7.5 and SummarizedExperiment 1.42.0 wrote the candidates. The scripts read each native object back, verify the count totals, and check that both metadata and sparse sidecars identify the same observations. A fresh replay reproduced all six CLI outcomes.