call_cq
Amplification curves to Cq, one row per reaction. Fits each raw fluorescence curve to a sigmoid (l4-l7, b4-b7), reads the Cq off it under any of the seven definitions (cpD1, cpD2, maxE, expR, Cy0, CQ, maxRatio) or at a fluorescence threshold you set (the classic Ct), and returns the per-reaction efficiency and the fit-quality block beside it, so a bad fit is visible next to the Cq it produced rather than hidden behind it.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"curves": "<curves>"
},
"name": "call_cq"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | which sigmoid is fitted before a Cq is read off it. Ignored when `auto_model` is on, except as the starting point mselect ranks from. Values: l4 (l4 · 4-param log-logistic), l5 (l5 · + asymmetry), l6 (l6 · + linear baseline drift), l7 (l7 · + quadratic baseline), b4 (b4 · 4-param logistic (raw scale)), b5 (b5 · + asymmetry), b6 (b6 · + linear baseline drift), b7 (b7 · + quadratic baseline). | l4 |
| shift | No | cycles added to every reported Cq, for aligning against an instrument's own numbering. Advanced. | |
| _files | No | The project: record references shaped like _subject. Their records become library documents a tool names in sequences/parts/document; a trace or alignment is found by file name. | |
| curves | Yes | the amplification table: a header row, first column the cycle number and every other column one reaction's fluorescence. Tab- or comma-separated, and read by the same parser the Curve->Cq tab uses. | |
| amounts | No | the known template amount of each reaction, in column order (comma- or space-separated, `-` for a reaction with none). Each reaction given one reports its calibration factor `cf`, the amount over `init1`, the fit's fluorescence at cycle 0, which is what an absolute quantification scales an unknown's `init1` by. Advanced. | |
| _subject | No | The record to act on: exactly one of sequence, accession (+source), sample (an id from list_samples) or file ({name, text} or {name, base64}); record_index picks one record of several. | |
| cq_method | No | which Cq definition. These are genuinely different quantities, not one number under several names. Values: cpD2 (cpD2 · second-derivative max), cpD1 (cpD1 · first-derivative max), maxE (maxE · cycle of maximum efficiency), expR (expR · exponential region), Cy0 (Cy0 · tangent x-intercept (Guescini)), CQ (CQ · 20 % of the Cq fluorescence), maxRatio (maxRatio · spline, model-free (Shain)). | cpD2 |
| criterion | No | how auto_model ranks. The nested tests are only meaningful inside one family (l4-l7 or b4-b7); AICc weights is the one that can rank all eight. The reduced chi-square needs a measurement error per cycle and the only honest source is the plate's own replicates, so it REFUSES a plate with none. Values: ftest (Nested F-test (within family)), ratio (Likelihood ratio (within family)), weights (AICc weights (all eight models)), chisq (Reduced chi-square (needs replicates)). Only applies when auto_model is true. | ftest |
| threshold | No | a fluorescence threshold, on the plate's own fluorescence scale. Set, every Cq is the cycle where the fitted curve crosses it (the classic threshold cycle, Ct) and `cq_method` is overridden. Blank reads the Cq under `cq_method`. A reaction that never reaches it has no Cq and says so. | |
| auto_model | No | let the plate choose its own model. mselect runs on the FIRST reaction and its winner is applied to every reaction, because Cqs fitted under different models are not comparable — the result reports which model won and the full ranking table. | |
| baseline_to | No | last cycle of that window. In cycle. Advanced. | |
| baseline_from | No | first cycle of the window the sliwin and LRE estimators scan a baseline over. Affects the all-methods table only: the sigmoidal fit and its Cq do not use a baseline scan. In cycle. Advanced. | |
| baseline_scan | No | how many SDs of offset the baseline scan searches; 0 subtracts nothing, which is upstream's own default and is WRONG on real instrument data. Measured against the real LinRegPCR over the 47 reactions of the bundled Own Mix B plate: scanning gives a median efficiency disagreement of 0.038, not scanning gives 0.460. The result reports what the other setting would have returned, so the choice is never hidden. In SD. Advanced. | |
| outlier_method | No | which kinetic-outlier test judges the reaction shapes. Two are univariate and three judge a curve's whole shape against a robust MCD covariance of the plate, so a plate can look clean under one and dirty under another. Values: uni1 (Efficiency Z-score (Bar)), uni2 (Shape: cpD1 − cpD2 (Tichopad)), multi1 (Multivariate: cpD1 vs cpD2 residual (Tichopad MOD1)), multi2 (Multivariate: slope, Fmax (Tichopad MOD2)), multi3 (Multivariate: slope, F at cpD1, Fmax (Sisti)). Advanced. | uni2 |
| max_ratio_smooth | No | smooth the raw curve before the maxRatio spline is drawn, as qpcR's `eff(smooth = TRUE)` does. Moves only the `maxRatio` Cq. Only applies when cq_method is maxRatio. Advanced. | |
| max_ratio_baseshift | No | fluorescence added to every cycle before the maxRatio spline is drawn. qpcR's own remedy when a baseline near zero makes the cycle-to-cycle ratio explode; it moves only the `maxRatio` Cq. Only applies when cq_method is maxRatio. Advanced. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | Yes | one row per reaction: Cq, cpD1, cpD2, efficiency, the fit-quality block, take-off and midpoint, the initial fluorescence two ways (`init1` the fit at cycle 0, `init2` the fluorescence at the Cq over E^Cq), and `cf`, the known amount over `init1` for a reaction given one (NaN otherwise) | |
| count | Yes | how many reactions were fitted | |
| model | Yes | the model that produced these Cqs, named: a Cq without its model is not comparable, and under `auto_model` this is the one that WON rather than the one you asked for | |
| failed | Yes | reactions whose fit did not converge. A non-zero count is a finding about the plate, not a warning to swallow | |
| methods | Yes | the all-methods table: the same reactions measured four independent ways (sigmoidal fit, sliwin, expfit, LRE) with each failure NAMED, plus what sliwin returns under the other baseline setting. Agreement between them is the evidence a well is clean | |
| cqMethod | Yes | the Cq definition used: `cpT` when a `threshold` was set, since a threshold overrides `cq_method` | |
| outliers | Yes | the kinetic-outlier verdicts, including the reactions the test could not MEASURE — reported as not judged with the reason, never as passing | |
| errorNote | Yes | a plate-level note from the fit (for example a reaction the model could not fit); null when there is none | |
| threshold | Yes | the fluorescence threshold every Cq was read at; null when the Cq came from `cq_method` instead | |
| modelTable | Yes | the full model ranking when `auto_model` chose one — logLik, AIC, AICc, residual variance, F test, likelihood ratio, AICc weight and reduced chi-square per model. Null when the model was given rather than chosen | |
| modelChosen | Yes | the curve model the ranking chose when the model was not given; null when it was given | |
| outlierStat | Yes | which statistic judged them, or the refusal when the plate could not support the test | |
| zeroCrossing | Yes | reactions whose fluorescence crosses zero after `max_ratio_baseshift` is added, where the spline estimators put a pole in the series and would return a confident 1e16. Named rather than printed | |
| meanEfficiency | Yes | mean per-reaction efficiency over the reactions that fitted, as a percentage | |
| amplificationPlot | Yes | the raw amplification curves as read from the plate, one line per reaction, fluorescence against cycle |