Usage: Web UI
This walks through the browser-based Twitcher Workbench viewer feature by feature, in the order you normally use it. Configure resources in Settings, upload a CSV (01 Upload), filter and explore the table (02 Explore), then open per-event visualizations (03 Inspect). The app header shows the same three stages as a progress indicator.
See Usage: Web UI Server for how to start twb serve with Singularity, Docker, or a local/pip install. This document assumes the server is running and open in your browser.
Settings
The Settings drawer (gear icon, top right) holds reference resources, processing options, visualization defaults, and column visibility. Open it before your first upload, or later to change any of them.
Reference and supporting files
- Reference genome (
.fa/.fa.gz). Pick a bundled genome from the dropdown, or click Upload custom reference for a one-off file. This is the only resource that is always required. - Gene annotation (
.gff3, optional). Enables gene/exon context annotation and the gene-context visualization panel. - Repeat mask (
.gff3.gz, optional). Enables Alu, LINE, SINE, LTR, DNA-transposon, and tandem-repeat annotation. - Raw alignment viewer (
.bam+.bai, optional). Enables the BAM action button on table rows, and the BAM alignments track in JBrowse2. The upload lasts for the current browser session only.
BAM/BAI upload is automatic. Choose the BAM file and its BAI index in either order – there’s no separate “upload” step to remember. As soon as both are selected, the upload starts right away; the status line next to each file switches from “Selected: …” to “Ready: …” once it finishes. If something goes wrong, use Re-upload BAM + BAI to retry without re-selecting the files.
Your browser remembers bundled reference, annotation, and mask selections between sessions. See Reference/annotation data for how to prepare genome, GFF3, and mask files under ref/ so they show up in these dropdowns.
CSV files on the server
This menu is in the CSV data card on the main page (under the upload button), not in Settings. It is shown only when twb serve was started with --csv-dir or --csv (see Usage: Web UI Server). Pick a file from the menu and press Start loading / Start processing; nothing starts on selection. Files that look already processed tick “CSV is already processed” for you. The file is read in place on the server and is never uploaded or copied.
BAM files on the server
Shown in Settings under Raw alignment viewer only when twb serve was started with --bam-dir. Choose a BAM from the BAM on the server menu; it is used in place for the BAM button and the JBrowse alignments track, with no upload or copy. The BAM chip in the Processing card on the main page shows which BAM is selected, whether it came from the server or from an upload.
CSV processing options
These options control what happens when you upload a CSV.
- CSV is already processed skips all post-processing below and loads the file as-is. Use it for a CSV that the workbench or
twb clialready produced. It loads almost instantly because no reference or annotation work is needed. - Basic preprocessing normalizes raw Twitcher output columns and derives workbench fields. You need it the first time you load a raw Twitcher CSV.
- Repeated-event handling sets how observations of the same underlying event are grouped, for example the same event seen in several samples of a trio. There are three modes.
- Group and retain all observations is the default and the recommended mode for trios and multi-sample datasets. It keeps every row, and the table shows one expandable representative row per group.
- Collapse repeated groups keeps one row per group.
- Do not group turns off deduplication and grouping.
ts_1_4_region_maximalandts_2_3_maxwhen both are present for a row; when either is missing or could not be computed, it falls back to matching the raw exactts_1_4_region/ts_2_3pair instead (needed for output from an algorithm, such as Twitcher’s--fpa, that never computes a maximal extent at all). A row where neither pair is usable is its own unique group. It does not use event ID, cluster ID, or sample name, so the rawsample_namevalue stays unchanged. The in-app “How are repeated events matched?” disclosure gives the full rule. - Sequence complexity adds microsatellite, entropy, LZ-ratio, and low-complexity annotation.
- TSM interpretation adds confidence labels, mechanism hints, and TSM-related scoring fields.
- Gene context adds nearby gene, exon, and genomic-context annotation. It needs a gene annotation GFF3 selected above.
- Repeat masking adds Alu, LINE, SINE, LTR, DNA, tandem, and low-complexity annotation. It needs a repeat mask selected above.
These five processing steps (basic preprocessing, sequence complexity, TSM interpretation, gene context, repeat masking) are also independently toggleable from twb cli via --skip-steps; see Usage: CLI.
Visualization options
- Twitcher zoom and Twitcher uncertainty ranges control how the Inspect stage renders the Twitcher alignment visualization.
- DNA fold layout picks the RNAplot layout algorithm. The default is linear/turtle. The alternatives are radial, Naview, circular, and RNApuzzler.
- DNA fold stringency covers no lonely pairs, the dangling-end model, partition function/BPP, the MFE gate, minimum stem and loop length, and the MEA structure. The workbench passes these settings to
RNAfoldeach time you open a DNA fold comparison.
Filter dropdown values and visible columns
These options sit lower in the same drawer.
- Load categorical filter values. For large datasets, the upload skips dropdown value lists for categorical filters to keep the UI responsive. Click this button to load them when you need them.
- Visible columns. The processed CSV has many columns. Search them, show all, reset to the core view, or pick which ones appear in the table. Changes apply immediately.
01 Upload
Choose a CSV file with the Choose file button on the CSV data card. What happens next depends on the CSV processing options in Settings.
- A raw Twitcher CSV with the default processing options runs the full pipeline shown above. This takes from a few seconds to about a minute, depending on dataset size and whether the gene annotation has to load from scratch.
- With “CSV is already processed” checked, the upload goes straight to loading the table.
When processing finishes, the Dataset summary dashboard appears with headline statistics for the whole dataset. It shows total events, duplicates removed, likely-TSM percentage, tandem-repeat percentage, forward and template-switch edit deltas, and the exonic, intronic, and intergenic breakdown.
02 Explore
The data table
Each row is one event. With grouping enabled, a row can instead be the representative row of a repeated-event group. From left to right, a row has:
- Pedigree/sample badges. Each sample in a multi-sample dataset gets one pill, which is filled in when that sample has an observation for this event. Click a badge to open the sample display label editor for that sample.
- ☆ / ★ save. Bookmarks the event into the Saved events panel (see below).
- ↻ sync. Refreshes any open linked viewer windows (Twitcher, JBrowse, DNA fold, BAM) for this event.
- Twitcher ↗. Opens the Twitcher alignment visualization.
- JBrowse. Opens a JBrowse2 session scoped to the event’s region.
- DNA fold. Opens the reference vs. reconstructed-query RNA secondary-structure comparison.
- BAM. Opens a raw
samtools tviewslice around the event. It appears only after you upload a BAM/BAI pair in Settings.
Repeated-event groups
With “Group and retain all observations” enabled, click the ▸ arrow on a row to expand every observation in that group. This helps when you compare a TSM candidate across a trio.
Filtering
The Filters panel has two interchangeable editing modes. A separate pedigree-style Group filters section sits underneath.
Visual Builder
Click + Add Rule to add a column/operator/value rule. The column field is a searchable combobox. Combine rules with the query builder’s AND/OR controls. You can also stack rules with the Group filters below them. For example, you can require a TSM confidence label and require the event to be present in two specific samples of a trio.
Group filter operators:
- Present in all selected labels. Every selected sample or label has an observation of this event, for example parent and child concordance.
- Present in any selected label. At least one selected sample has an observation.
- Absent from all selected labels. None of the selected samples has an observation.
- Exactly these labels. The samples with an observation of the event match the selection exactly.
Click Apply query to run the filter. The Filters · N active badge and the DataTables row count both update.
Advanced Text mode
Switch to Advanced Text to write queries in a plain-text language. It supports parentheses, AND/OR, quoted string values, numeric comparisons, region operators, and CIGAR operators. Click Parse and apply. The parsed rule count and any diagnostics appear below the editor.
Supported filter operators:
eq, neq, contains, not_contains, starts_with, ends_with,
gt, lt, gte, lte, empty, notempty, in, notin,
has_any, has_all, has_none,
region_overlaps, region_within, region_contains, region_distance_lt
For multi-value categorical fields, has_any means OR within one cell and has_all means AND within one cell. For example, gene_names has_all BRCA1,TP53 requires the pipe-separated gene_names field of the same observation to contain both values. See “Supported filter operators” in docs/usage-cli.md for the full list with usage notes. It includes the region and CIGAR operators for columns such as cluster_region, ts_1_4_region, and ts_tsigar_ctx.
Filter presets
To reuse a combination of rules and group filters, click Save current filters and give it a name. Saved presets appear in the dropdown with their rule count. You can re-apply, delete, export, or import them as JSON.
Built-in presets. Presets curated by the app appear first in the dropdown (group “Built-in”) and as ★ chips, before the ones you saved. Click one to apply it; selecting it in the dropdown shows what it does. Built-in presets cannot be deleted or edited and are not included in Export JSON. If you want a variant, apply it, change the rules, and save it under your own name.
| Preset | What it keeps |
|---|---|
| Strict candidates (8 rules) | The most stringent criteria of the Nextflow pipeline: ts_2_3_max ≥ 10, tsm_copy_identity = 1, duplicate_group_is_representative = 1, delta_total_mismatch_bp ≥ 1, delta_total_edit_bp ≥ 2, repeat_overlap = 0, and identity_20bp_upstream/identity_20bp_downstream ≥ 0.9. On the demo dataset (ASH_chr11.csv) this leaves 26 of 3,992 groups. It is a screening filter, not proof that an event is a template switch. |
The same set on the command line is twb cli -O -f ts_2_3_max:gte:10 -f tsm_copy_identity:eq:1 -f duplicate_group_is_representative:eq:1 -f delta_total_mismatch_bp:gte:1 -f delta_total_edit_bp:gte:2 -f repeat_overlap:eq:0 -f identity_20bp_upstream:gte:0.9 -f identity_20bp_downstream:gte:0.9. A rule whose column is missing from the loaded CSV is skipped and the status line names it, so check that message before trusting a filtered view. Rows where ts_2_3_max holds several values (for example 10|8) are not numeric and fail the ≥ 10 rule, exactly as in the CLI.
To add or change a built-in preset, edit src/backend/builtin_filter_presets.json (same format as exported presets, plus id, description and filter_mode) and rebuild the image.
- Export JSON and Import JSON let you share a preset with another user or reuse it from the CLI.
- Importing a preset adds it to the preset library but does not apply it. Select the imported preset and click Apply preset.
- To reproduce a web filter in the CLI, pass
-A allor-A anyto match the AND/OR combination mode. See Usage: CLI.
Preset JSON files use frontend-style filter objects:
{
"schema": "twitcher_filter_presets",
"version": 1,
"exportedAt": "2026-06-03T11:02:00.000Z",
"presets": [
{
"id": "preset_1780492344850_ybn021t5lg",
"name": "Perfect 30bp identity",
"filters": [
{
"col": "identity_30bp_upstream",
"op": "eq",
"val": "1"
},
{
"col": "identity_30bp_downstream",
"op": "eq",
"val": "1"
}
]
}
]
}Saved events
Click the ☆ button on any row to bookmark it into the Saved events panel. Bookmarks do not depend on the current filter. Each saved event keeps its own quick-action buttons and shows whether the currently loaded CSV still contains it.
- Locate scrolls to the event in the table and highlights it, if the current CSV contains it.
- If you load a different CSV, saved events missing from it show “ID not found in current CSV”. They stay saved, so they reappear when you reload the original file.
Sample display labels
Click a sample/pedigree badge, or the identity column’s label, to rename how the table displays a sample_name. The underlying identifier does not change.
The label applies to every event with that exact identifier in the current dataset. Your browser keeps it across reloads of the same file.
03 Inspect
Clicking Twitcher, JBrowse, DNA fold, or BAM on a row opens that visualization in a new browser window or tab. The ↻ sync button on the row refreshes all open viewer windows for that event at once.
The Twitcher visualization, DNA fold panels, and event-context view share these zoom and pan controls:
- Scroll to zoom.
- Drag to pan.
- Press F to fit.
- Press Esc to close, where supported.
Twitcher visualization
Shows the real twitcher viz alignment output for the event. It has reference, query, and complement sequences with template-switch segments, breakpoint uncertainty ranges, and inline CIGAR annotation.
Use Save SVG to export the current visualization.
DNA fold comparison
Runs RNAfold with the stringency settings from Settings on both the reference sequence and the reconstructed query/read sequence around the event. It shows the two secondary structures side by side, each with independent pan/zoom and its own Save SVG button.
RNAfold (ViennaRNA) must be installed and on the server’s PATH. If it is not, both panels show a [Errno 2] No such file or directory: 'RNAfold' error instead of a fold.
JBrowse2
Opens a full JBrowse2 session scoped to the event’s region. Its tracks are the reference sequence, gene annotation, repeat masking, TSM loci, TSM jump arcs, a per-cluster summary, template-switch jumps, and the local CIGAR footprint. If you’ve also uploaded a BAM/BAI pair in Settings, a BAM alignments track is added and shown by default, so you can browse and zoom into the real read alignments alongside every other track. If no BAM is uploaded (or the uploaded files can’t be found), JBrowse opens normally without that track – it never blocks the rest of the session.
Raw BAM slice
After you upload a BAM/BAI pair in Settings, the BAM button on a row shows the alignments around the event’s region. With a reference genome selected, it renders a samtools tview slice. If no reference is selected, or tview fails or returns nothing, it falls back to samtools view and shows the raw SAM output, which is the header plus any overlapping alignment records.
The amount of flanking sequence padded onto each side of the event’s region is controlled by the BAM slice window (bp) field in Settings, next to the BAM/BAI upload controls (default 120bp). Raise it to see more context around the event, or lower it to zoom in tighter; the setting is remembered between sessions.
Coverage and read support (COV)
The COV button next to BAM reads the selected BAM (uploaded, or from --bam / --bam-dir) around the event and shows, in a popup:
- a depth profile over the event span ± the BAM slice window (Settings), with the event shaded and the flank mean marked;
- the flank depth (zero-filled; positions with no reads count as 0), the depth inside the event, and a ±10 bp flank depth that matches the pipeline’s
flank_depth; - with a reference selected, how many reads carry the event: the number of reads whose sequence is closer (edit distance) to the event haplotype than to the reference, out of the reads that span the event. The fraction, its 95% confidence interval and the haplotag (HP) split are shown, and the call is one of:
| Call | Meaning |
|---|---|
| Inconclusive | fewer than 5 reads span the event |
| No support | no spanning read carries it |
| Singleton | exactly one supporting read |
| Low | below 10% of spanning reads |
| Intermediate | 10% to 30% |
| Het-like | 30% to 70% |
| Hom-like | 70% or more |
The event haplotype is rebuilt from the CSV (ref_ctx_region + fw_cigar_ctx + fw_mi_ctx). Only the CIGAR edits at the event (within 10 bp of cluster_region) are used; distant edits are read-specific sequencing noise and are ignored, and the panel says how many were ignored.
Why not just use duplicate_group_count: it counts rows in a repeated-event group. That equals the number of supporting reads only when every row is one read (Twitcher reads mode on a HiFi BAM). For VCF-mode and assembly-BAM runs a row is an event in a sample, so read support has to come from the BAM. The CSV’s duplicate_group_count, flank_depth, relative_depth and allele_count are shown next to the BAM-derived numbers for comparison when present.
These calls are screening cut-offs, not genotypes. The thresholds come from one HiFi chromosome (HG002 chr20_MATERNAL), not from a published source. Known limits:
- Reads that do not span the whole event window cannot be classified (short reads over a long event, soft-clipped insertion reads), so support can be under-counted. If fewer than 5 reads span the default window (100 bp flanks), a shorter 30 bp flank is tried.
- Repeat expansions can be ambiguous: the same expansion can be placed at different repeat units by different events.
- Events with a core longer than 1,500 bp are not classified.
- Against a single-haplotype assembly, a heterozygous event is not expected at exactly 0.5.
Checked on chr20_MATERNAL HiFi events (42 events): the ±10 bp flank depth equals the pipeline’s flank_depth for every event. For the 12 of 14 largest groups where the event is cleanly resolved, the BAM-derived read count is within about 5 of duplicate_group_count, and singletons agree. The remaining 2 of the 14 were repeat or complex-region events.
Appearance
The Night / Light toggle (top right, next to Settings) switches the whole UI between dark and light themes. Your browser remembers the choice between sessions.


















