Skip to content

pyLocusZoom 2.0.0

Choose a tag to compare

@michael-denyer michael-denyer released this 21 Jul 15:41
f4aa549

Completes the rendering seam begun in 1.x and unifies validation on a single
engine.

Breaking changes

Custom backends must migrate. The PlotBackend protocol now carries drawing
primitives only. Full migration guide:
Custom backends in 2.0.

  • The five semantic legend methods (add_ld_legend, add_effect_legend,
    add_eqtl_legend, add_finemapping_legend, add_simple_legend) and the old
    add_legend(handles, labels) are replaced by one neutral
    add_legend(ax, entries, loc, title) taking backend-neutral LegendEntry
    values. Legend content is built once by pure functions in
    backends/composition.py.
  • add_recombination_overlay is removed. composition.render_recombination_overlay()
    composes it from primitives. create_twin_axis(ax) returns an opaque
    SecondaryAxis handle that every *_secondary primitive takes first.
  • The supports_snp_labels and supports_secondary_axis booleans are gone.
    Optional capabilities are negotiated with @runtime_checkable protocols
    (SupportsRegionHighlight, SupportsSNPLabels, SupportsSecondaryAxis)
    checked by isinstance. supports_hover remains a boolean.

No compatibility shim is provided.

Load-time validation rejects nulls consistently. validate_eqtl_dataframe,
validate_finemapping_dataframe, and validate_genes_dataframe now reject
nulls in the numeric columns they range-check, matching
validate_gwas_dataframe. Previously a file with a blank p_value, pip,
start, or end loaded silently and lost those rows later. Plot-time intake is
unchanged and still filters nulls with a warning.

Two never-read parameters removed: validate_gwas_dataframe(rs_col=) and
validate_finemapping_dataframe(cs_col=).

Legend styling is uniform across plot families. Versus 1.x: the LD lead-SNP
marker is 7pt rather than 6pt, eQTL/fine-mapping/effect legend text is 9pt
rather than 8pt, and the effect legend gained an "Effect" title. Legend content,
colours, and ordering are unchanged.

Fixed

  • Plotly and Bokeh legends now honour loc and edgecolor. Both accepted
    and discarded them, hard-coding an upper-right legend with black borders, so
    loc="lower left" still covered plotted data.
  • The LD legend title renders as mathtext again, restoring the italic r².
    The convert_latex_to_unicode table also silently dropped the exponent
    ($r^2$ became "r"); it now yields "r²".
  • Non-numeric confidence-interval columns report a validation error instead
    of a raw pandas TypeError from forest validation.

Internal

schemas.py is expressed on DataFrameValidator, deleting a parallel
hand-rolled implementation; require_pvalue gives the (0, 1] domain one owner
shared with plot-time intake. Recombination header detection and coordinate
liftover are now pure functions behind a CoordinateLifter port, tested without
network or pyliftover.

Full detail in CHANGELOG.md.