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
    • Clustered heatmap with dendrograms
    • 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
    • Brush a million-point torus
    • Scrollable viewport
    • Zoomable t-SNE scatter plot
  • Example datasets
  • API reference
    • genome_spy.Chart
    • genome_spy.ConcatChart
    • genome_spy.FacetChart
    • genome_spy.HConcatChart
    • genome_spy.ImportedView
    • genome_spy.LayerChart
    • genome_spy.MultiscaleChart
    • genome_spy.SurroundChart
    • 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.X2Offset
    • genome_spy.XOffset
    • genome_spy.Y
    • genome_spy.Y2
    • genome_spy.Y2Offset
    • 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.facet
    • 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.surround
    • 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.AggregateOp
    • genome_spy.AggregateParams
    • genome_spy.Align
    • genome_spy.AlignmentMismatchesParams
    • genome_spy.ArrowConfig
    • genome_spy.ArrowDirection
    • genome_spy.ArrowProps
    • genome_spy.ArrowRelativeSize
    • genome_spy.ArrowSize
    • genome_spy.Axis
    • genome_spy.AxisConfig
    • genome_spy.AxisGenomeData
    • genome_spy.AxisLabelLayoutParams
    • genome_spy.AxisOrient
    • genome_spy.AxisPlacement
    • genome_spy.AxisTicksData
    • genome_spy.BamData
    • genome_spy.Baseline
    • genome_spy.BedDataFormat
    • genome_spy.BedpeDataFormat
    • genome_spy.BigBedData
    • genome_spy.BigWigData
    • genome_spy.BindCheckbox
    • genome_spy.BindInput
    • genome_spy.BindRadioSelect
    • genome_spy.BindRange
    • genome_spy.Binding
    • genome_spy.BranchParams
    • genome_spy.BrushConfig
    • genome_spy.BuiltInThemeName
    • genome_spy.CategorySelectionChannel
    • genome_spy.CategorySelectionParameterColor
    • genome_spy.CategorySelectionParameterFill
    • genome_spy.CategorySelectionParameterShape
    • genome_spy.CategorySelectionParameterStroke
    • genome_spy.CategorySelectionParameterX
    • genome_spy.CategorySelectionParameterY
    • genome_spy.ChannelWithScale
    • genome_spy.ChromPosDef
    • genome_spy.ChromosomalLocus
    • genome_spy.CollectParams
    • genome_spy.ColorDef
    • genome_spy.ColorSchemeConfig
    • genome_spy.CompareParams
    • genome_spy.ComplexDomain
    • genome_spy.ConcatSpec
    • genome_spy.ConditionalMarkPropExprDefType
    • genome_spy.ConditionalMarkPropExprDefTypeForShape
    • genome_spy.ConditionalMarkPropFieldDefType
    • genome_spy.ConditionalMarkPropFieldDefTypeForShape
    • genome_spy.ConditionalParameterMarkPropExprDefType
    • genome_spy.ConditionalParameterMarkPropExprDefTypeForShape
    • genome_spy.ConditionalParameterMarkPropFieldDefType
    • genome_spy.ConditionalParameterMarkPropFieldDefTypeForShape
    • genome_spy.ConditionalParameterScaleDatumDef
    • genome_spy.ConditionalParameterValueDefNumberExprRef
    • genome_spy.ConditionalParameterValueDefStringNullExprRef
    • genome_spy.ConditionalScaleDatumDef
    • genome_spy.ConditionalTestMarkPropExprDefType
    • genome_spy.ConditionalTestMarkPropExprDefTypeForShape
    • genome_spy.ConditionalTestMarkPropFieldDefType
    • genome_spy.ConditionalTestMarkPropFieldDefTypeForShape
    • genome_spy.ConditionalTestScaleDatumDef
    • genome_spy.ConditionalTestValueDefNumberExprRef
    • genome_spy.ConditionalTestValueDefStringNullExprRef
    • genome_spy.ConditionalValueDefNumberExprRef
    • genome_spy.ConditionalValueDefStringNullExprRef
    • genome_spy.Contig
    • genome_spy.CoordinateLookupInput
    • genome_spy.CoordinateLookupParams
    • genome_spy.CoreRootSpec
    • genome_spy.CoverageParams
    • genome_spy.CrossData
    • genome_spy.CrossInput
    • genome_spy.CrossParams
    • genome_spy.CsvDataFormat
    • genome_spy.Data
    • genome_spy.DataFormat
    • genome_spy.DataSource
    • genome_spy.DebouncedExprParameter
    • genome_spy.DendrogramParams
    • genome_spy.DirectionDef
    • genome_spy.Displace1DParams
    • genome_spy.Displace2DParams
    • genome_spy.DomEventType
    • genome_spy.DomainValue
    • genome_spy.DomainValueArray
    • genome_spy.DsvDataFormat
    • genome_spy.DynamicCallbackData
    • genome_spy.DynamicOpacity
    • genome_spy.Encoding
    • genome_spy.EventConfig
    • genome_spy.ExplicitlyOrderedDendrogramParams
    • genome_spy.ExprDef
    • genome_spy.ExprFilterParams
    • genome_spy.ExprParameter
    • genome_spy.ExprRef
    • genome_spy.Expression
    • genome_spy.FacetFieldDef
    • genome_spy.FacetHeader
    • genome_spy.FacetMapping
    • genome_spy.FacetSpacing
    • genome_spy.FacetSpec
    • genome_spy.FadedMultiscaleStops
    • genome_spy.Field
    • genome_spy.FieldDefWithoutScale
    • genome_spy.FieldName
    • genome_spy.FieldOrDatumDefWithConditionMarkPropFieldDefTypeForShapeStringNull
    • genome_spy.FieldOrDatumDefWithConditionMarkPropFieldDefTypeNumber
    • genome_spy.FieldOrDatumDefWithConditionMarkPropFieldDefTypeStringNull
    • genome_spy.FieldOrDatumDefWithConditionScaleDatumDefNumber
    • genome_spy.FieldOrDatumDefWithConditionScaleDatumDefStringNull
    • genome_spy.FigWigData
    • genome_spy.FilterParams
    • genome_spy.FilterScoredLabelsParams
    • genome_spy.FlattenCigarParams
    • genome_spy.FlattenCompressedExonsParams
    • genome_spy.FlattenDelimitedParams
    • genome_spy.FlattenParams
    • genome_spy.FlattenSequenceParams
    • genome_spy.FontStyle
    • genome_spy.FontWeight
    • genome_spy.FormulaParams
    • genome_spy.Generator
    • genome_spy.GenomeAxis
    • genome_spy.GenomeConfig
    • genome_spy.GenomeConfigBase
    • genome_spy.GenomeDefinition
    • genome_spy.GenomeSpyConfig
    • genome_spy.GenomeSpySchema
    • genome_spy.Gff3Data
    • genome_spy.GradientIntervalSelectionParameterColor
    • genome_spy.GradientIntervalSelectionParameterFill
    • genome_spy.GradientIntervalSelectionParameterStroke
    • genome_spy.HConcatSpec
    • genome_spy.HandledTooltip
    • genome_spy.IdentifierParams
    • genome_spy.ImportSpec
    • genome_spy.IndexDendrogramParams
    • genome_spy.IndexUrlSourceRef
    • genome_spy.IndexUrlTemplate
    • genome_spy.IndexedFastaData
    • genome_spy.InlineData
    • genome_spy.InlineDataset
    • genome_spy.InlineGenomeConfig
    • genome_spy.InlineGenomeDefinition
    • genome_spy.InlineLocusAssembly
    • genome_spy.InteractionEventType
    • genome_spy.IntervalSelectionParameter
    • genome_spy.JsonDataFormat
    • genome_spy.KeyDef
    • genome_spy.LayerSpec
    • genome_spy.LazyData
    • genome_spy.LazyDataParams
    • genome_spy.Legend
    • genome_spy.LegendConfig
    • genome_spy.LegendDirection
    • genome_spy.LegendLayout
    • genome_spy.LegendOrient
    • genome_spy.LegendRegionAnchor
    • genome_spy.LegendRegionLayout
    • genome_spy.LegendResolutionBehavior
    • genome_spy.LegendTitleOrient
    • genome_spy.LerpTransition
    • genome_spy.LinearizeGenomicCoordinateParams
    • genome_spy.LinkConfig
    • genome_spy.LinkProps
    • genome_spy.LookupParams
    • genome_spy.LookupSelfInput
    • genome_spy.MarkConfig
    • genome_spy.MarkPropDefNumber
    • genome_spy.MarkPropDefStringNull
    • genome_spy.MarkPropDefStringNullTypeForShape
    • genome_spy.MarkPropExprDef
    • genome_spy.MarkPropExprDefType
    • genome_spy.MarkPropExprDefTypeForShape
    • genome_spy.MarkProps
    • genome_spy.MarkType
    • genome_spy.MeasureTextParams
    • genome_spy.MergeFacetsParams
    • genome_spy.MultiUrlSourceRef
    • genome_spy.MultiscaleSpec
    • genome_spy.MultiscaleStops
    • genome_spy.MultiscaleStopsDef
    • genome_spy.NamedData
    • genome_spy.NamedGenomeConfig
    • genome_spy.NamedSelectionPredicateRef
    • genome_spy.NumericDomain
    • genome_spy.NumericMarkPropDef
    • genome_spy.NumericStopDef
    • genome_spy.NumericValueDef
    • genome_spy.OffsetChannel
    • genome_spy.OffsetDef
    • genome_spy.OrderCondition
    • genome_spy.OrderDef
    • genome_spy.OtherDataFormat
    • genome_spy.OverhangConfig
    • genome_spy.PackLegendLabelsParams
    • genome_spy.PaddingConfig
    • genome_spy.Paddings
    • genome_spy.ParamTransition
    • genome_spy.Parameter
    • genome_spy.ParameterPredicate
    • genome_spy.Parse
    • genome_spy.ParseValue
    • genome_spy.PileupParams
    • genome_spy.PlainExprParameter
    • genome_spy.PlainValueParameter
    • genome_spy.PointConfig
    • genome_spy.PointProps
    • genome_spy.Position2Def
    • genome_spy.PositionDatumDef
    • genome_spy.PositionDef
    • genome_spy.PositionExprDef
    • genome_spy.PositionFieldDef
    • genome_spy.PositionValueDef
    • genome_spy.PositionalChannel
    • genome_spy.PositionalIntervalSelectionParameter
    • genome_spy.PrimaryPositionalChannel
    • genome_spy.ProjectParams
    • genome_spy.RangeConfig
    • genome_spy.RecordSelectionParameter
    • genome_spy.RectConfig
    • genome_spy.RectProps
    • genome_spy.RegexExtractParams
    • genome_spy.RegexFoldParams
    • genome_spy.ResolutionBehavior
    • genome_spy.ResolutionMapLegendResolutionBehavior
    • genome_spy.ResolutionMapResolutionBehavior
    • genome_spy.Root
    • genome_spy.RuleConfig
    • genome_spy.RuleProps
    • genome_spy.RulerChannelValue
    • genome_spy.RulerClear
    • genome_spy.RulerConfig
    • genome_spy.RulerDisplay
    • genome_spy.RulerEventConfig
    • genome_spy.RulerEventType
    • genome_spy.RulerExtent
    • genome_spy.RulerInitMapping
    • genome_spy.RulerMarkConfig
    • genome_spy.RulerParameter
    • genome_spy.RulerSnap
    • genome_spy.RulerSource
    • genome_spy.SampleParams
    • genome_spy.Scalar
    • genome_spy.ScalarDomain
    • genome_spy.Scale
    • genome_spy.ScaleConfig
    • genome_spy.ScaleGroupsData
    • genome_spy.ScaleInterpolate
    • genome_spy.ScaleInterpolateParams
    • genome_spy.ScaleType
    • genome_spy.SchemeParams
    • genome_spy.SearchDef
    • genome_spy.SecondaryChromPosDef
    • genome_spy.SecondaryOffsetChannel
    • genome_spy.SecondaryOffsetDef
    • genome_spy.SecondaryPositionalChannel
    • genome_spy.SelectionDomainRef
    • genome_spy.SelectionExtent
    • genome_spy.SelectionFilterParams
    • genome_spy.SelectionInitIntervalMapping
    • genome_spy.SelectionParameter
    • genome_spy.SelectionPredicateDefinition
    • genome_spy.SelectionPredicateOperand
    • genome_spy.SelectionUnionTest
    • genome_spy.SeparatorProps
    • genome_spy.SequenceGenerator
    • genome_spy.SequenceParams
    • genome_spy.SetIntersectionParams
    • genome_spy.ShapeDef
    • genome_spy.SiblingOrderedDendrogramParams
    • genome_spy.SingleUrlSourceRef
    • genome_spy.SizeDef
    • genome_spy.SortOrder
    • genome_spy.StackParams
    • genome_spy.Step
    • genome_spy.StringDatumDef
    • genome_spy.StringFieldDef
    • genome_spy.StrokeAlign
    • genome_spy.StyleConfig
    • genome_spy.SurroundPlotSpec
    • genome_spy.SurroundSide
    • genome_spy.SurroundSideSpec
    • genome_spy.SurroundSides
    • genome_spy.SurroundSpec
    • genome_spy.TabixTsvData
    • genome_spy.TemplateImport
    • genome_spy.TextConfig
    • genome_spy.TextDef
    • genome_spy.TextProps
    • genome_spy.TickConfig
    • genome_spy.TickProps
    • genome_spy.Title
    • genome_spy.TitleAnchor
    • genome_spy.TitleConfig
    • genome_spy.TitleFrame
    • genome_spy.TitleOrient
    • genome_spy.TooltipDef
    • genome_spy.TransformOutput
    • genome_spy.TransformParams
    • genome_spy.TransitionedExprParameter
    • genome_spy.TransitionedMultiscaleStops
    • genome_spy.TransitionedValueParameter
    • genome_spy.TruncateTextParams
    • genome_spy.Type
    • genome_spy.TypeForShape
    • genome_spy.UnitSpec
    • genome_spy.UrlData
    • genome_spy.UrlGenomeConfig
    • genome_spy.UrlGenomeDefinition
    • genome_spy.UrlImport
    • genome_spy.UrlList
    • genome_spy.UrlSourceRef
    • genome_spy.UrlTemplate
    • genome_spy.VConcatSpec
    • genome_spy.ValueDefArrowDirection
    • genome_spy.ValueDefNumber
    • genome_spy.ValueDefString
    • genome_spy.ValueDefWithConditionNumberType
    • genome_spy.ValueDefWithConditionStringNullType
    • genome_spy.ValueDefWithConditionStringNullTypeForShape
    • genome_spy.ValueParameter
    • genome_spy.ValuesParams
    • genome_spy.VariableParameter
    • genome_spy.VcfData
    • genome_spy.VcfDataFormat
    • genome_spy.ViewBackground
    • genome_spy.ViewConfig
    • genome_spy.ViewOpacityDef
    • genome_spy.ViewSpec
    • genome_spy.ViewportDomainRef
    • genome_spy.ViewportSizeDef
    • genome_spy.WigDataFormat
    • genome_spy.WindowOnlyOp
    • genome_spy.WindowOp
    • genome_spy.WindowParams
    • genome_spy.ZoomParams
    • 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
  • Integrations
    • Scanpy
      • UMAP and embeddings
      • PCA diagnostics
      • Expression plots
      • Expression tracks
      • Linked expression summaries
      • Ranked genes
      • PAGA graphs and paths
      • Profiles and simulations
      • Data checks
      • Save and export
      • Scanpy compatibility
      • API reference
  • 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¶

  • Write user-facing guides for first-time users. Use plain words, short sentences, and short paragraphs. Avoid jargon and tangents. Keep only what helps readers understand or use the example. Link to references for advanced details.

  • 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