Alias entry point

Track Construction

Use helper methods for most figures, add_track() when names come from configuration, and explicit track classes only when you need direct object construction.

Helper methods

from plotnado import GenomicFigure
from plotnado.examples import REGION, intervals, signal
# signal() → DataFrame(chrom, start, end, value) — replace with a BigWig path/URL or DataFrame
# intervals() → DataFrame(chrom, start, end, name) — replace with a BED/BigBed path, URL, or DataFrame

fig = GenomicFigure(track_height=1.2)
fig.autocolor("Set2")
fig.scalebar()
fig.bigwig(signal(), title="Signal", style="fill", color_group="sample-a")
fig.bed(intervals(), title="Intervals", display="expanded", show_labels=True, color_group="sample-a")
fig.axis()
fig.plot(REGION)

Helper methods keep ordinary figure construction readable and chainable.

add_track() is useful when track names are read from YAML, TOML, or another runtime source.

from plotnado import GenomicFigure
from plotnado.examples import REGION, signal
# signal() → DataFrame(chrom, start, end, value) — replace with a BigWig path/URL or DataFrame

fig = GenomicFigure().autocolor("Dark2")
fig.add_track("scalebar")
fig.add_track("axis")
fig.add_track("bigwig", data=signal(phase=0.0), title="Replicate A", alpha=0.75)
fig.add_track("bigwig", data=signal(phase=0.8), title="Replicate B", alpha=0.75)
fig.plot(REGION)

Aliases map to the same track constructors used by helper methods.

Explicit objects

Use explicit classes when you need to pass track objects around before adding them.

from plotnado import BigWigTrack, GenomicFigure
from plotnado.examples import signal
# signal() → DataFrame(chrom, start, end, value) — replace with a BigWig path/URL or DataFrame

track = BigWigTrack(data=signal(), title="Reusable signal", style="fill")
fig = GenomicFigure().add_track(track)

Kwarg routing

Helper methods route shorthand kwargs automatically:

fig.bigwig(
    signal(),
    title="H3K27ac",        # label
    title_color="black",    # label
    style="fill",           # aesthetics
    color="#1f77b4",        # aesthetics
    alpha=0.8,              # aesthetics
)

The explicit nested form is still available:

fig.bigwig(
    signal(),
    aesthetics={"style": "fill", "color": "#1f77b4", "alpha": 0.8},
    label={"title": "H3K27ac", "title_color": "black"},
)

Overlay tracks

Treat the overlay as the panel that owns the shared scale.

from plotnado import GenomicFigure
from plotnado.examples import REGION, review_signal
# review_signal() → DataFrame(chrom, start, end, value) — replace with BigWig paths/URLs or DataFrames

fig = GenomicFigure(track_height=1.2)
fig.autoscale(True)
fig.highlight("chr1:1,032,000-1,046,000")
fig.highlight_style(color="#ffdd57", alpha=0.22)
fig.bigwig(review_signal(2.0), title="Control", autoscale_group="signal", color="#1f77b4")
fig.bigwig(review_signal(10.0, 1.2), title="Treatment", autoscale_group="signal", color="#d62728")
fig.overlay(
    [review_signal(5.5, 2.0), review_signal(6.5, 2.8)],
    title="Overlay",
    autoscale_group="signal",
    colors=["#2ca02c", "#9467bd"],
    alpha=0.55,
)
fig.plot(REGION)

Ordinary signal tracks and the overlay share one autoscale_group.

Option lookup

from plotnado import GenomicFigure

GenomicFigure.available_track_aliases()
GenomicFigure.track_options("bigwig")
GenomicFigure.track_options("overlay")
GenomicFigure.track_options_markdown("genes")

See Track Aliases, Track Catalog, and Compact Options.