openreadout_batch/lib.rs
1//! Measurements across many instrument files as one tidy table.
2//!
3//! Real questions span folders: "mean GFP intensity per condition", "which wells failed",
4//! "median CD4 per donor". This crate is the layer that answers them:
5//!
6//! - [`run()`] runs a [`Measure`] (pixel statistics, trace statistics, table summaries, gated
7//! population counts and medians, header metadata, and any command that implements the trait)
8//! over files, directories, glob patterns or an index query, in parallel, with failures as
9//! rows, multi-file data sets counted once and results in a deterministic order;
10//! - [`sheet`] reads sample sheets (CSV, TSV, XLSX/XLS/ODS) and plate layouts (plate-map grids,
11//! 96 to 1536 wells) and [`join()`] attaches their annotations to the rows, choosing the key
12//! (file name, path, sample id recorded in the file, plate well, barcode, vial, run order)
13//! from the data and reporting unmatched and ambiguous rows;
14//! - [`summarize()`] aggregates a table by annotation columns (n, mean, sd, median, CV %),
15//! optionally averaging technical replicates first and testing groups against a control
16//! (Welch's t-test, Mann–Whitney U);
17//! - [`mod@write`] writes tables as JSON, JSON Lines, CSV, TSV or Parquet, and reads them back;
18//! - [`link()`] groups files that measured the same sample across instruments, with the
19//! evidence and a confidence for every link;
20//! - [`csv`] writes one table or one sweep of a trace as a verified CSV file (`export --format
21//! csv`, `openreadout_export` format `csv`).
22//!
23//! The CLI (`--tidy`, `batch`, `link`), the MCP server and the Python package are thin
24//! layers over these functions. `book/src/guides/batch.md` in the repository documents the behaviour.
25#![forbid(unsafe_code)]
26#![warn(missing_docs)]
27// Statistics and pairwise comparisons use the textbook names (a, b, n, t, u, x, …).
28#![allow(clippy::many_single_char_names)]
29
30pub mod analyze;
31pub mod api;
32pub mod companion;
33pub mod csv;
34pub mod export_format;
35pub mod join;
36pub mod link;
37pub mod measure;
38pub mod measures;
39pub mod output;
40pub mod pipeline;
41pub mod run;
42pub mod sheet;
43pub mod stat;
44pub mod summarize;
45pub mod table;
46pub mod well;
47pub mod write;
48
49pub use join::{JoinOptions, JoinReport, join};
50pub use link::{LinkOptions, LinkOutput, link};
51pub use measure::{Item, Measure};
52pub use output::BatchOutput;
53pub use pipeline::{Pipeline, PipelineResult, run_pipeline};
54pub use run::{BatchRequest, BatchResult, IndexQuery, InputReport, run};
55pub use summarize::{SummarizeRequest, SummaryOutput, summarize};
56pub use table::{Column, ColumnDoc, ColumnType, Role, Row, Table, Value};