Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
genome-spy-python
Logo
genome-spy-python
  • Getting started
  • User guide
    • Data and chart inputs
    • Charts and marks
    • Encodings and channels
    • Scales, axes, and legends
    • Transforms
    • Expressions
    • Composition
    • Import remote view specifications
    • Configuration
    • Chromosomes and locus scales
    • Large and indexed genomic data
    • Build linked genome tracks
    • Label points and genomic intervals
    • Parameters and interaction
    • Using and sharing charts
      • Charts in notebooks
      • Save, export, and share charts
      • Use chart interactions in Python
      • Interactive workflows
        • Annotate genomic intervals
        • Select genes for follow-up
        • Pick individual genes
        • Edit a sequence
  • Gallery
    • Manhattan plot
    • Brush-linked genome tracks
    • Volcano plot
    • MA plot
    • Volcano plot
    • PBMC UMAP
    • PBMC UMAP panels
    • PBMC marker matrix
    • PBMC cell heatmap
    • PBMC expression tracks
    • Dynseq binding-QTL tracks
    • Adaptive dynseq binding-QTL tracks
    • PISA squid plot
    • PISA interaction matrix
    • Genome tracks with gene annotations
    • Stacked genome browser tracks
    • Composing a genome browser
    • ONT direct-RNA coverage and read alignments along RNF7
    • Sashimi plot
    • BAM coverage and read pileup
    • BAM read alignments
    • Chromosome ideogram
    • GFF3 gene annotations
    • RefSeq genes with scored labels
    • BigBed cCRE track
    • Indexed FASTA six-frame translation
    • Indexed FASTA sequence track
    • Multiple sequence alignment
    • P53 multiple-sequence alignment with an overview brush
    • Sequence logo
    • Lollipop plot
    • PIK3CA mutation lollipop plot
    • Rainfall plot
    • ClinVar variants track
    • Oncoplot
    • LAML oncoplot with clinical and pathway annotations
    • LUAD oncoprint
    • Copy-number profile
    • ASCAT copy-number segmentation
    • Interactive ASCAT purity/ploidy fitting
    • HCC1954 structural variants and copy number
    • TCGA ovarian cancer GISTIC landscape
    • Set intersections with an UpSet plot
    • Point mark
    • Rect heatmap
    • Horizontal stacked bars
    • Layered lollipop plot
    • Layered charts with independent scales
    • Point shapes and styles
    • Positive and negative bars
    • Ranged rule mark
    • Coverage and interval pileup
    • Link mark
    • Vertical concatenation
    • Heatmap with zoomable values
    • Points that grow when zooming
    • Brush-linked penguin summaries
    • Scrollable viewport
    • Zoomable t-SNE scatter plot
  • Example datasets
  • API reference
    • genome_spy.Chart
    • genome_spy.ConcatChart
    • genome_spy.HConcatChart
    • genome_spy.ImportedView
    • genome_spy.LayerChart
    • genome_spy.MultiscaleChart
    • genome_spy.TopLevelSpec
    • genome_spy.VConcatChart
    • genome_spy.Angle
    • genome_spy.Color
    • genome_spy.Direction
    • genome_spy.Dx
    • genome_spy.Dy
    • genome_spy.FacetIndex
    • genome_spy.Fill
    • genome_spy.FillOpacity
    • genome_spy.Key
    • genome_spy.Locus
    • genome_spy.Opacity
    • genome_spy.Order
    • genome_spy.Sample
    • genome_spy.Search
    • genome_spy.SemanticScore
    • genome_spy.Shape
    • genome_spy.Size
    • genome_spy.Stroke
    • genome_spy.StrokeOpacity
    • genome_spy.StrokeWidth
    • genome_spy.Text
    • genome_spy.Tooltip
    • genome_spy.UniqueId
    • genome_spy.X
    • genome_spy.X2
    • genome_spy.XOffset
    • genome_spy.Y
    • genome_spy.Y2
    • genome_spy.YOffset
    • genome_spy.axes
    • genome_spy.binding
    • genome_spy.binding_checkbox
    • genome_spy.binding_radio
    • genome_spy.binding_range
    • genome_spy.binding_select
    • genome_spy.compare
    • genome_spy.concat
    • genome_spy.condition
    • genome_spy.config
    • genome_spy.data_format
    • genome_spy.datum
    • genome_spy.dynamic_opacity
    • genome_spy.expr
    • genome_spy.hconcat
    • genome_spy.import_view
    • genome_spy.layer
    • genome_spy.locus
    • genome_spy.multiscale
    • genome_spy.param
    • genome_spy.parse
    • genome_spy.ruler
    • genome_spy.scales
    • genome_spy.selection_interval
    • genome_spy.selection_point
    • genome_spy.step
    • genome_spy.title
    • genome_spy.to_arrow_ipc
    • genome_spy.value
    • genome_spy.vconcat
    • genome_spy.view
    • genome_spy.view_config
    • genome_spy.when
    • genome_spy.AxisGenomeData
    • genome_spy.BrushConfig
    • genome_spy.Data
    • genome_spy.DataFormat
    • genome_spy.DynamicOpacity
    • genome_spy.ExprRef
    • genome_spy.Expression
    • genome_spy.GenomeAxis
    • genome_spy.HandledTooltip
    • genome_spy.Legend
    • genome_spy.NamedSelectionPredicateRef
    • genome_spy.Paddings
    • genome_spy.Parameter
    • genome_spy.ParameterPredicate
    • genome_spy.Parse
    • genome_spy.RulerMarkConfig
    • genome_spy.Scale
    • genome_spy.SelectionDomainRef
    • genome_spy.SelectionPredicateDefinition
    • genome_spy.SelectionPredicateOperand
    • genome_spy.SelectionUnionTest
    • genome_spy.SizeDef
    • genome_spy.Step
    • genome_spy.Title
    • genome_spy.data.LazyNamespace
    • genome_spy.data_transformers.DataTransformerSettings
    • genome_spy.anndata.from_anndata
    • genome_spy.anndata.AnnDataProjectionError
    • genome_spy.datasets.available_datasets
    • genome_spy.datasets.load_dataset
    • genome_spy.datasets.DatasetNotFoundError
    • genome_spy.JupyterChart
  • About
Back to top

Repository language and gallery standards¶

These requirements supplement AGENTS.md. Read the language sections for Python changes and the gallery section for documentation examples.

Python conventions¶

  • Type hints on all public APIs

  • Use list[T], dict[K, V], X | Y — never typing.List, Optional

  • src/ layout; explicit __all__ on public packages

  • Protocols (PEP 544) over ABCs for structural typing

  • @dataclass(frozen=True, slots=True) for value objects

  • pathlib for paths; os for env vars only

  • Prefer functions over single-use classes

  • Fail fast: custom exceptions with contextual messages; zero silent failures

  • logging.getLogger(__name__) — never print() or logging.basicConfig()

  • Explicit imports and predictable control flow over cleverness; no package-level magic re-exports

  • Keep modules small and names descriptive.

Docstrings¶

Use Google-style docstrings for every public API via sphinx.ext.napoleon. Types belong in signatures only and should not be repeated in docstrings.

Required public API sections:

  • Summary

  • Description

  • Args

  • Returns

  • Raises

  • Example

Documentation gallery¶

  • Keep documentation examples focused on the GenomeSpy visualization API, not statistical analysis or general-purpose data wrangling. Prepare derived example datasets, including p-values, adjusted p-values, transformed values, classifications, and plotting domains, in src/genome_spy/datasets/ or in curated packaged data files. Examples should load the prepared table and demonstrate encodings, marks, transforms, and composition directly.

  • Prefer Altair-style composition operators in examples when they express the intended structure clearly: + for layers, & for vertical concatenation, and | for horizontal concatenation.

  • Documentation gallery embeds must use the direct static GenomeSpy bundle import followed by embed(c, spec, { bare: true }). Keep the chart container direct and avoid transform or resize wrappers around the embedded canvas; this is the known-working path for all gallery plots, including sashimi.

  • Keep adapted gallery pages self-contained. Link the corresponding official GenomeSpy example as further reading, not as a substitute for local explanation.

  • Put extended prose in an optional same-stem Markdown companion under docs/examples/.

  • For the same data and processing, reuse the official GenomeSpy example’s concise provenance or disclaimer wording. Update it when the sample, region, subset, preprocessing, or intended use differs.

  • Keep provenance as brief as possible. Include only details needed to identify the data, disclose material processing, satisfy attribution or licensing, or prevent misuse. Use a note-styled admonition titled Data use and provenance; do not repeat it as a section heading.

  • Adapt What to notice and implementation prose to the chart actually rendered. Verify every claim about data, encodings, transforms, interaction, and composition against the checked-in Python source.

  • Explicitly distinguish processing performed in Python from GenomeSpy’s browser-side dataflow. State whether an example loads a prepared packaged table, derives or filters data in Python, or sends data to GenomeSpy for declarative transforms.

  • Do not describe packaged derived data as raw source data or imply that .transform_*() methods execute in Python. The Python API authors and serializes those transform definitions; GenomeSpy executes them while rendering or interacting with the visualization in the browser.

Copyright © genome-spy-python contributors
Made with Sphinx and @pradyunsg's Furo
On this page
  • Repository language and gallery standards
    • Python conventions
    • Docstrings
    • Documentation gallery