clophfit.fitting.pipeline#

Pipeline orchestrators for fitting multistage workflows (e.g., FGLS).

Functions#

fgls_plate_fit(datasets, sigma_floor, *[, ...])

Run iterative Feasible Generalized Least Squares (FGLS) on a plate.

fit_plate(datasets[, method])

Run a single-pass fit on an entire plate of datasets.

Module Contents#

clophfit.fitting.pipeline.fgls_plate_fit(datasets, sigma_floor, *, first_pass_method='huber', second_pass_method='lm', max_iter=3, tol=0.001)#

Run iterative Feasible Generalized Least Squares (FGLS) on a plate.

  1. First-pass fit (robust) on each well with existing y_errc.

  2. Calibrate noise model from residuals, anchoring floor to sigma_floor.

  3. Re-apply calibrated weights, re-fit, re-calibrate — iterating until gain and alpha converge or max_iter is reached.

  4. Return final fits and the noise model from the last calibration.

Parameters:
  • datasets (dict[str, Dataset]) – Plate datasets keyed by well name.

  • sigma_floor (dict[str, float]) – Known read-noise floor per label (e.g. from buffer wells).

  • first_pass_method (str) – Method for the first-pass fit (default "huber").

  • second_pass_method (str) – Method for subsequent passes (default "lm").

  • max_iter (int) – Maximum FGLS iterations (default 3).

  • tol (float) – Relative tolerance for gain/alpha convergence (default 1e-3).

Returns:

Final fit results keyed by well, and the converged (or last) calibrated noise model.

Return type:

tuple[dict[str, FitResult[Any]], PlateNoiseModel]

clophfit.fitting.pipeline.fit_plate(datasets, method='', **kwargs)#

Run a single-pass fit on an entire plate of datasets.

Parameters:
  • datasets (dict[str, Dataset]) – A mapping of well keys (e.g. ‘A01’) to Dataset objects.

  • method (str) – The fitting method to use: ‘lm’ (default), ‘huber’, ‘odr’, or ‘mcmc’. Other methods supported by clophfit.fitting.core.fit_binding_glob() may also be used.

  • **kwargs (Any) – Additional keyword arguments passed to the specific fitting function.

Returns:

A dictionary mapping well keys to their corresponding FitResult.

Return type:

dict[str, FitResult[Any]]