summarize_rows
Reduce a whole TABLE column to one number — the largest band, the median guide score, the spread of a set of melting temperatures. This is what makes a CROSS-ROW check expressible: check_rows can only assert the same thing of every row, so "the largest fragment is at least twice the smallest" needed two summaries and a comparison and had nowhere to come from. Name a group_field and it summarizes each group instead of the whole table (the mean product size per template), emitting a table a gate can then check group by group; pick a pairwise operation and it relates two columns of the same rows.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| trim | No | the fraction to drop from EACH end before averaging, 0-0.5. datamash's own bound: 0.5 keeps only the middle value. Only applies when operation is trimmean. | |
| field | No | which field of each row to reduce (e.g. `size`, `score`). Leave empty when the rows are plain numbers; a tuple row is indexed by number, so `0` is the first column. | |
| items | Yes | the rows to summarize. Wire a json/list output (bands, guides, assays, amplicons). | |
| label | No | what this summary IS, in your words. It becomes the message the run reports. | |
| _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. | |
| _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. | |
| operation | No | which summary to take. The vocabulary is GNU datamash's, so a number here is the number `datamash <op>` gives for the same column. The last four relate TWO columns and need a `second_field`. Values: sum (sum), min (minimum), max (maximum), absmin (smallest by magnitude), absmax (largest by magnitude), range (range (max − min)), count (count of values), first (first value), last (last value), mode (most common value), antimode (least common value), unique (the distinct values, sorted), collapse (every value, in order), countunique (count of distinct values), mean (mean), geomean (geometric mean), harmmean (harmonic mean), trimmean (trimmed mean), median (median), q1 (lower quartile), q3 (upper quartile), iqr (interquartile range), perc (percentile), pstdev (standard deviation (population)), sstdev (standard deviation (sample)), pvar (variance (population)), svar (variance (sample)), ms (mean square), rms (root mean square), mad (median absolute deviation, scaled), madraw (median absolute deviation, unscaled), sskew (skewness (sample)), pskew (skewness (population)), skurt (excess kurtosis (sample)), pkurt (excess kurtosis (population)), jarque (Jarque–Bera normality p-value), dpo (D'Agostino–Pearson normality p-value), scov (covariance (sample)), pcov (covariance (population)), spearson (Pearson correlation (sample)), ppearson (Pearson correlation (population)). | max |
| percentile | No | which percentile to take, 0–100. In %. Only applies when operation is perc. | |
| group_field | No | split the rows by this field first and summarize each group: `template` on a multiplex screen, `strand` on a guide table. Leave empty to summarize the whole table. | |
| second_field | No | the second column for the pairwise operations, the one this field is related TO (e.g. `gc` against `size`). Only applies when operation is scov or pcov or spearson or ppearson. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| used | Yes | how many of those rows actually carried a number. Lower than `count` means the column has gaps, and the summary says so rather than implying it read them all | |
| count | Yes | how many rows went into it: a summary of three bands and a summary of thirty are different claims | |
| value | Yes | the summary itself. Wire it into a gate's `value` or its `against`; with a `group_field` this is the first group's value, and `groups` is the table you want | |
| groups | Yes | one row per group (`{ group, value, count, used }`) when a `group_field` is set. Wire it into `check_rows` to gate every group at once | |
| number | Yes | the same answer as a number, so it can drive a numeric port directly. Absent for the text summaries (`first`, `unique`, …) | |
| message | Yes | what was summarized, in words | |
| groupCount | Yes | how many distinct groups the split found. Absent when nothing was grouped — an ungrouped summary has no group count, and a 0 would read as one |