Skip to main content

Crate openreadout_batch

Crate openreadout_batch 

Source
Expand description

Measurements across many instrument files as one tidy table.

Real questions span folders: “mean GFP intensity per condition”, “which wells failed”, “median CD4 per donor”. This crate is the layer that answers them:

  • run() runs a Measure (pixel statistics, trace statistics, table summaries, gated population counts and medians, header metadata, and any command that implements the trait) over files, directories, glob patterns or an index query, in parallel, with failures as rows, multi-file data sets counted once and results in a deterministic order;
  • sheet reads sample sheets (CSV, TSV, XLSX/XLS/ODS) and plate layouts (plate-map grids, 96 to 1536 wells) and join() attaches their annotations to the rows, choosing the key (file name, path, sample id recorded in the file, plate well, barcode, vial, run order) from the data and reporting unmatched and ambiguous rows;
  • summarize() aggregates a table by annotation columns (n, mean, sd, median, CV %), optionally averaging technical replicates first and testing groups against a control (Welch’s t-test, Mann–Whitney U);
  • write writes tables as JSON, JSON Lines, CSV, TSV or Parquet, and reads them back;
  • link() groups files that measured the same sample across instruments, with the evidence and a confidence for every link;
  • csv writes one table or one sweep of a trace as a verified CSV file (export --format csv, openreadout_export format csv).

The CLI (--tidy, batch, link), the MCP server and the Python package are thin layers over these functions. book/src/guides/batch.md in the repository documents the behaviour.

Re-exports§

pub use join::JoinOptions;
pub use join::JoinReport;
pub use join::join;
pub use link::LinkOptions;
pub use link::LinkOutput;
pub use measure::Item;
pub use measure::Measure;
pub use output::BatchOutput;
pub use pipeline::Pipeline;
pub use pipeline::PipelineResult;
pub use pipeline::run_pipeline;
pub use run::BatchRequest;
pub use run::BatchResult;
pub use run::IndexQuery;
pub use run::InputReport;
pub use run::run;
pub use summarize::SummarizeRequest;
pub use summarize::SummaryOutput;
pub use summarize::summarize;
pub use table::Column;
pub use table::ColumnDoc;
pub use table::ColumnType;
pub use table::Role;
pub use table::Row;
pub use table::Table;
pub use table::Value;

Modules§

analyze
The analyses by name: one entry point, picked by kind, configured by options (the same options openreadout_batch takes for that measure). The MCP analysis tools (openreadout_peaks, openreadout_nmr_peaks, …, openreadout_assay), the Python openreadout.analyze() and the R openreadout_analyze() call it.
api
Requests by name, as the MCP tools (openreadout_batch, openreadout_link) and the Python package (openreadout.batch(), summarize(), link()) send them: one JSON shape for both.
companion
Files that sit next to instrument data in a lab folder without being data: sample sheets, sequences, plate maps, compound or region lists (CSV, TSV, text, workbooks) and documents (READMEs, PDFs). A batch over the folder skips them and says so, instead of reporting each as an unknown-format error; files that look like data and no reader recognises still are errors.
csv
export --format csv: one table (e.g. an FCS data set) to a CSV file, written to a temporary file, read back and compared value by value, then renamed into place.
export_format
The export format an output name implies, shared by openreadout export and the openreadout_export tool so that both read -o x.ome.zarr the same way.
join
Joining a sample sheet or plate layout onto a batch table.
link
link: which files measured the same sample (or are the same acquisition stored twice), across instruments and formats, with the evidence for every link.
measure
The Measure trait: what a command computes for one data set, as rows of a tidy table.
measures
The built-in measures: stats, trace, table, gate, info and scans, and the analyses (peaks, chromatogram, assay, nmr-peaks, ephys-features, spikes, qpcr; stats per well) through AnalysisMeasure.
output
The JSON shape of a batch table (--tidy --json, MCP openreadout_batch): a report of what went in (inputs, joins), the columns with roles and units, the rows as arrays in column order (a page of them when a limit is set), the group summary when one was asked for, and where the full table was written.
pipeline
The whole table-mode pipeline, shared by the CLI, the MCP server and the Python package: run a measure, join sample sheets, filter rows, select columns, summarize, write.
run
Running a Measure over many inputs.
sheet
Sample sheets and plate layouts.
stat
Small, exact-enough statistics for group summaries: descriptive statistics, Welch’s t-test and the Mann–Whitney U test, with p-values defined as SciPy defines them (scipy.stats.ttest_ind(equal_var=False), scipy.stats.mannwhitneyu(method="auto"), both two-sided), and checked against SciPy in the tests and the corpus harness.
summarize
Group summaries of a batch table: n, mean, sd, sem, median, min, max and CV % per group and value column, optionally averaging technical replicates first and comparing every group with a control group (Welch’s t-test or Mann–Whitney U).
table
The tidy table: typed cells, columns with a role and a unit, and rows assembled from the name/value pairs measures produce.
well
Plate well names: A1, A01, a001, B-12, AF48 (1536-well plates have rows A–AF and columns 1–48), R3C7, and row/column pairs. Every form becomes a zero-based (row, column) and a canonical name A01.
write
Writing tables (CSV, TSV, JSON Lines, JSON, Parquet) and reading them back (for summarize TABLE).