Repository navigation
pyLocusZoom 2.0.0
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-neutralLegendEntry
values. Legend content is built once by pure functions in
backends/composition.py. add_recombination_overlayis removed.composition.render_recombination_overlay()
composes it from primitives.create_twin_axis(ax)returns an opaque
SecondaryAxishandle that every*_secondaryprimitive takes first.- The
supports_snp_labelsandsupports_secondary_axisbooleans are gone.
Optional capabilities are negotiated with@runtime_checkableprotocols
(SupportsRegionHighlight,SupportsSNPLabels,SupportsSecondaryAxis)
checked byisinstance.supports_hoverremains 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
locandedgecolor. 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².
Theconvert_latex_to_unicodetable 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 pandasTypeErrorfrom 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.