draw_trace
Draw a window of a Sanger read as an SVG figure: the four dye traces over their called bases, the per-base Phred bars and a base ruler.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| from | No | first base drawn, 1-based and inclusive. Clamped into the read. | |
| bases | No | how many bases to draw. Keep it to a window you can read: past about 120 the peaks are narrower than the letters over them. | |
| width | No | figure width. It SETS the per-base zoom for the window asked for, never crops it. In px. | |
| _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. | |
| palette | No | which ink each dye is drawn in. `print` is the default here because the figure travels outside the app and onto white; `cvd` is the color-vision-deficiency-safe set. Values: classic (Classic (ABI)), cvd (Color-blind safe), print (Print (on white)). | |
| quality | No | print the per-base Phred bars. A file with no confidence (many SCFs) draws none whatever this says. | |
| _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 draw: its name (`read_F.ab1`) or its project file id. A file id is project-specific, so a template ships this unset. | |
| bases_row | No | print the called bases between the ruler and the peaks. Advanced. | |
| trace_height | No | height of the peak band, under the ruler, quality and base rows. In px. Advanced. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| svg | Yes | the trace window as an SVG figure | |
| read | Yes | the read drawn | |
| width | Yes | figure width in px | |
| height | Yes | figure height in px | |
| lastBase | Yes | last base drawn, 1-based inclusive | |
| sequence | Yes | the calls in the window drawn, so the picture and the string cannot disagree | |
| firstBase | Yes | first base drawn, 1-based inclusive, AFTER clamping into the read | |
| hasQuality | Yes | whether this file carries per-base confidence at all | |
| meanQuality | Yes | mean Phred over the window drawn, or 0 when the file carries no confidence — read `hasQuality` beside it rather than reading 0 as bad calls |