Repository navigation
OriginalWLS
CLI: --model original_wls. Class: loqculate.compat.wls.OriginalWLS. Registered on MODEL_REGISTRY when you import loqculate.
Port of old/calculate-loq.py process_peptide(model='piecewise'). I keep it so a rewrite can still be compared to the paper script. It is not a drop-in for PiecewiseCF: the LOQ rule is different, and LOD guards are different.
The original script used lmfit. This class uses scipy.optimize.least_squares(..., method="trf") with the same
- At least 3 observations and at least 2 unique
$x$ , elseValueError. - Weights:
min(1/(sqrt(x)+eps), 1000), same cap asinverse_sqrt_weights. - Init:
_initialize_params_legacy(top-two concentrations). - Solver: TRF,
max_nfev=5000. Unlike PiecewiseWLS, a solver failure is not caught;result.xis used as returned. - LOD and bootstrap LOQ are computed inside
fit(), not lazily.
lod(std_mult) and loq(cv_thresh) after fit ignore those arguments and return the values stored at fit time. Constructor std_mult and cv_thresh (defaults 2 and 0.20) are the ones that matter. The CLI passes --std_mult / --cv_thresh into lod() / loq() after fit, so those CLI flags do not change OriginalWLS output. --bootreps is also not forwarded (name does not start with piecewise).
_calculate_lod_legacy:
-
$a \le 0$ $\to$ $\infty$ . -
$x_{\mathrm{int}} = (c-b)/a$ . -
$\sigma$ from all$y$ with$x < x_{\mathrm{int}}$ ,ddof=1, if at least one such point; otherwise$\sigma=\infty$ . -
$\mathrm{LOD} = (c + \mathrm{std_mult}\cdot\sigma - b)/a$ . - If
$\mathrm{LOD} > \max(x)$ ,$\infty$ . - Let
inner_pointsbe unique$x$ with the global min and max removed. If that set is empty, or$\mathrm{LOD} < \min(\mathrm{inner_points})$ ,$\infty$ .
min_noise_points and min_linear_points are accepted on the constructor and passed into this function. They are not read in the function body.
Bootstrap predictions on np.linspace(LOD, max(x), 100). Per-replicate seed SeedSequence(i) for i in range(n_boot), matching the original _bootstrap_once. CV is std/mean with ddof=1 on the bootstrap matrix.
Single-point rule, strict inequality:
No sliding window. If none, or the min is
This is not find_loq_threshold, and it is not <=.
loqculate v0.4.1 | Home | Getting started | CLI reference | Troubleshooting | Changelog | MIT License
loqculate Wiki
Start
Models
Use loqculate
Solve a problem
Contribute