dash-seqviz

Drop real sequence biology into your Dash app — in one component.

Circular and linear viewers, GenBank / FASTA / NCBI loaders, annotations, primers, 250+ restriction enzymes, motif search, and rich callback state. Built for classrooms and industrial bio-foundries alike.

PyPI version conda-forge version License MIT
Open Explorer Read the Reference

What's in the box

Circular & linear views

Toggle between circular plasmid maps, linear sequence views, or show both side by side.

Annotations & primers

Overlay named annotations, directional primers, and highlight regions on any sequence.

Restriction enzymes

250+ NEB enzymes out of the box, plus custom recognition sites.

Motif search

Fuzzy motif search with configurable mismatch tolerance and search_results callback.

Custom colors

Full control over base-pair, annotation, translation, and highlight colors.

Dash callbacks

React to selection, search_results, clicked_element, and copy events with standard Dash callbacks.

Theming & dark mode

Light, dark, and auto themes (following a Mantine switch live), plus colorblind-safe palettes (Okabe-Ito, ColorBrewer, Paul Tol).

File parsing

Load FASTA / GenBank files or NCBI accessions into props with parse() and fetch_ncbi().

Figure export

Export the current viewer to a publication-ready SVG or PNG, straight from a Dash callback.

Accessibility

ARIA role and an auto-generated aria_label so screen readers announce the viewer meaningfully.

Large-genome guard

max_seq_length renders a lightweight placeholder instead of hanging the tab on multi-megabase sequences.

MLflow logging

Optional integration: log a viewer as an interactive HTML artifact and compare variants across runs.

Install

conda install -c conda-forge dash-seqviz
mamba install -c conda-forge dash-seqviz
pixi add dash-seqviz
pip install dash-seqviz

30-second example

from dash import Dash, html
from dash_seqviz import SeqViz

app = Dash(__name__)
app.layout = html.Div([
    SeqViz(
        id="demo",
        name="pUC19 fragment",
        seq="TTGACGGCTAGCTCAGTCCTAGGTACAGTGCTAGC",
        annotations=[
            {"start": 0, "end": 22, "name": "Promoter",
             "direction": 1, "color": "#2a9d8f"},
        ],
        enzymes=["EcoRI", "XbaI", "SpeI"],
        style={"height": "500px", "width": "100%"},
    )
])

if __name__ == "__main__":
    app.run(debug=True)