Skip to main content

Crate openreadout_assay

Crate openreadout_assay 

Source
Expand description

Plate-reader assay analysis: the standard next steps after reading a plate, as deterministic, documented building blocks.

  • Layouts: well roles (blank, standard, sample, positive/negative control, empty), samples, compounds, concentrations and dilutions from a plate-map grid or long CSV, from the layout a vendor export embeds (Gen5 Well ID, SkanIt Sample, BMG Content), or from well flags.
  • Wells: blank subtraction (mean of the blanks), replicate groups (mean, SD, CV %), outlier flags (modified z-score or Grubbs).
  • Standard curves: linear, 4PL, 5PL least squares with weighting, parameter standard errors and confidence intervals, R², residuals, back-calculated concentrations with range flags and LLOQ/ULOQ.
  • Dose-response: IC50/EC50 with confidence interval, Hill slope, top and bottom per compound, optionally normalised to controls.
  • Kinetics and growth curves: max slope (Vmax), lag, time to max, AUC; growth rate, doubling time, logistic fit.
  • Assay quality: Z′, signal/background, signal/noise, SSMD, CVs.

Methods and conventions: book/src/guides/plate-analysis.md. Validation against SciPy, R drc and growthcurver (run as black boxes) and against vendor-computed results stored in Gen5 and SkanIt exports: docs/provenance/plate-analysis.md.

§Example

use std::path::Path;

use openreadout_assay::{Analysis, AssayRequest, analyze_file};
use openreadout_core::Registry;

let req = AssayRequest {
    analysis: Analysis::Curve,
    standards: Some("A1,A2=100;B1,B2=50;C1,C2=25;D1,D2=12.5;E1,E2=6.25".into()),
    blank_wells: Some("H1,H2".into()),
    ..AssayRequest::default()
};
let out = analyze_file(&registry(), Path::new("elisa.txt"), &req)?;
for w in &out.wells {
    println!("{} {:?} {:?}", w.well, w.back_calculated, w.flag);
}

Modules§

fit
Curve models and least-squares fitting: straight line (closed form), four- and five-parameter logistic (Levenberg–Marquardt with analytic derivatives, several starting points), parameter standard errors and confidence intervals, and inverse prediction (back-calculation of a concentration from a signal).
kinetics
Per-well kinetic metrics (enzyme-style reads) and growth-curve metrics (OD over hours).
layout
Plate layouts: which well holds what (role, sample, compound, concentration, dilution).
stats
Descriptive statistics and the Student-t distribution (quantiles for confidence intervals, Grubbs critical values). Written from the textbook definitions: the regularized incomplete beta function by its continued fraction (DLMF 8.17.22) evaluated with the modified Lentz method, and ln Γ by the Lanczos approximation.

Structs§

AssayOutput
openreadout analyze assay-wells|assay-curve|dose-response|kinetics|growth|assay-qc --json data.
AssayRequest
An assay-analysis request. Every field has a default; analysis picks what to compute.
BlankSummary
Blank subtraction applied.
CompoundRow
Dose-response of one compound.
CurvePoint
One point of a fit.
CurveReport
Standard-curve report.
FitReport
A fitted curve.
GroupStats
Statistics of a group of control wells.
GrowthRow
Growth metrics of one well.
KineticRow
Kinetic metrics of one well.
LayoutSummary
Layout summary.
Obs
One value.
OutlierSummary
Outlier rule and result.
ParamRow
One fitted parameter.
PlateData
A plate: its reads, values and any layout the file embeds.
QualityReport
Assay quality of the plate (values as read, before blank subtraction).
ReadInfo
One measurement channel.
ReadSummary
The read analysed.
SampleRow
One replicate group.
WellRow
One well.

Enums§

Analysis
The analysis to run.
BlankMode
Blank subtraction.
FitOn
What the standard curve is fitted to.
Normalize
Dose-response normalisation.
OutlierRule
Outlier rule within a replicate group.
Reduce
How a kinetic read becomes one value per well in the endpoint analyses (wells, curve, dose-response, qc).

Constants§

DEFAULT_GRUBBS_ALPHA
Default Grubbs alpha.
DEFAULT_MAD_THRESHOLD
Default modified z-score cut-off.
DEFAULT_WINDOW
Smallest default window (points); the default is this or a tenth of the time points, whichever is larger (crate::kinetics::default_window).
LOQ_TOLERANCE_PERCENT
Standards whose mean back-calculated recovery is within 100 ± this percent (and CV at most this) set LLOQ/ULOQ.
MAD_MIN_GROUP
Smallest replicate group the modified z-score is applied to (the MAD of fewer values is degenerate: with three values it is the smaller of two distances).

Functions§

analyze_file
Run req on the plate in path (see load_plate).
load_plate
Load the plate of path: a long CSV (well, value, …) is read directly; anything else is opened with the registry (plate-reader exports).
render_plot
Render the curve of a curve or dose-response result as PNG bytes. None when the result has no curve.
render_text
A human-readable summary of a result.
run
Run an analysis on a plate. user is the layout from user_layout.
to_csv
Rows as CSV: the union of the rows’ keys in first-seen order; nested extra maps are flattened to extra.<key>.
user_layout
Build the user layout of a request: the layout file, then layout_text, then the well flags (blank_wells, positive_wells, negative_wells, empty_wells, standards), each overriding the previous well by well.
write_tables
Write the tidy tables of out under prefix; returns the paths written. A table path that is one of inputs is refused.