trim_trace
Trim a Sanger read's low-quality ends, by either of the two methods that answer different questions: the instrument's own Mott record as written into the file, or a sliding mean-Phred window computed here. Returns the kept interval as 1-based inclusive bounds, and the mean quality of what it KEPT beside the mean of what it DISCARDED — the pair that says whether the trim was worth making, because a trim whose discarded ends score no worse than the bases it left has shortened the read for nothing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| min_q | No | the mean Phred the window has to hold for a bound to stop walking inward. | |
| _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. | |
| method | No | auto = the file's own Mott record when it has one and the sliding window when it does not; mott = the instrument's record, which SCF and ZTR never carry; window = always compute it here. | auto |
| _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. | |
| document | No | which trace file to read: its name (`read_F.ab1`) or its project file id. A file id is project-specific, so a template ships this unset. | |
| win_size | No | bases in the sliding window, when the window method runs. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| reading | Yes | the same sentence the editor shows for this run, generated from it | |
| sequence | Yes | the trimmed read, ready to align or verify | |
| keptBases | Yes | how many bases survived. Wire it into a gate: a read trimmed to nothing is not a read | |
| methodUsed | Yes | which one actually ran. `auto` and `mott` both answer `window` when the file carries no Mott record, and a pipeline that assumed otherwise trimmed on a threshold nobody chose | |
| lastBaseKept | Yes | 1-based inclusive | |
| firstBaseKept | Yes | 1-based inclusive, matching every trim readout in the editor | |
| meanQualityKept | Yes | mean Phred over the kept interval | |
| meanQualityDiscarded | Yes | mean Phred over what was cut. Read it AGAINST the kept figure: if it is not lower, the trim removed nothing bad |