genome_spy.Scale¶
- class genome_spy.Scale(align=Undefined, assembly=Undefined, base=Undefined, bins=Undefined, clamp=Undefined, constant=Undefined, domain=Undefined, domainMax=Undefined, domainMid=Undefined, domainMin=Undefined, domainTransition=Undefined, exponent=Undefined, gapPositions=Undefined, gapWidth=Undefined, interpolate=Undefined, name=Undefined, nice=Undefined, numberingOffset=Undefined, padding=Undefined, paddingInner=Undefined, paddingOuter=Undefined, range=Undefined, reverse=Undefined, round=Undefined, scheme=Undefined, type=Undefined, viewport=Undefined, zero=Undefined, zoom=Undefined, **kwds)View on GitHub¶
Bases:
GenomeSpySchemaGenerated wrapper for
Scale.Methods
align(value)Return a copy with
alignupdated.assembly([value, contigs, url])Return a copy with
assemblyupdated.base(value)Return a copy with
baseupdated.bins(value)Return a copy with
binsupdated.clamp(value)Return a copy with
clampupdated.constant(value)Return a copy with
constantupdated.copy(*[, deep])Return a copy with optional keyword updates.
domain([value, encoding, expr, initial, ...])Return a copy with
domainupdated.domainMax(value)Return a copy with
domainMaxupdated.domainMid(value)Return a copy with
domainMidupdated.domainMin(value)Return a copy with
domainMinupdated.domainTransition(value)Return a copy with
domainTransitionupdated.exponent(value)Return a copy with
exponentupdated.gapPositions([value, expr])Return a copy with a
ExprRefgapPositions.gapWidth([value, expr])Return a copy with a
ExprRefgapWidth.interpolate([value, gamma, type])Return a copy with
interpolateupdated.name(value)Return a copy with
nameupdated.nice([value, interval, step])Return a copy with
niceupdated.numberingOffset(value)Return a copy with
numberingOffsetupdated.padding(value)Return a copy with
paddingupdated.paddingInner(value)Return a copy with
paddingInnerupdated.paddingOuter(value)Return a copy with
paddingOuterupdated.range(value)Return a copy with
rangeupdated.Return this class schema with referenced properties merged in.
reverse(value)Return a copy with
reverseupdated.round(value)Return a copy with
roundupdated.scheme([value, count, extent, name])Return a copy with a
SchemeParamsscheme.to_dict(*[, validate])Serialize this schema wrapper to a JSON-compatible dictionary.
to_json(*[, validate])Serialize this schema wrapper to formatted JSON.
type(value)Return a copy with
typeupdated.validate(instance)Validate an instance against this wrapper's schema.
viewport(value)Return a copy with
viewportupdated.zero(value)Return a copy with
zeroupdated.zoom([value, extent])Return a copy with a
ZoomParamszoom.- align(value)View on GitHub¶
Return a copy with
alignupdated.
- assembly(value=Undefined, /, *, contigs=Undefined, url=Undefined)View on GitHub¶
Return a copy with
assemblyupdated.- Parameters:
contigs (Sequence[Contig | dict[str, Any]]) – An array of contigs/sequences in the genome assembly.
url (str) – A URL to a
chrom.sizesfile, which is a tab-separated file with two columns: the sequence name and its size. You may want to strip alternative loci, haplotypes, and other non-canonical contigs from the file. Example:"https://genomespy.app/data/genomes/hg19/chrom.sizes"
- base(value)View on GitHub¶
Return a copy with
baseupdated.
- bins(value)View on GitHub¶
Return a copy with
binsupdated.
- clamp(value)View on GitHub¶
Return a copy with
clampupdated.
- constant(value)View on GitHub¶
Return a copy with
constantupdated.
- domain(value=Undefined, /, *, encoding=Undefined, expr=Undefined, initial=Undefined, mode=Undefined, param=Undefined, source=Undefined)View on GitHub¶
Return a copy with
domainupdated.- Parameters:
encoding (Literal['x', 'y']) – Selection interval channel to use. If omitted, GenomeSpy infers the channel from the scale channel when possible (e.g.,
x->x,x2->x,y->y,y2->y).expr (str) – The expression string.
initial (ScalarDomain_T | Sequence[ChromosomalLocus | dict[str, Any]]) – Initial configured domain for the linked scale when the linked interval selection is empty. Only supported when the linked scale is zoomable. Clearing the linked interval selection resets the domain to the normal default/data-derived domain instead of restoring
initial.mode (Literal['intersect', 'contain']) – Determines which positional values contribute to the domain.
"intersect"includes intervals that overlap the viewport."contain"requires both endpoints to be inside it, including its boundaries. Points use inclusive boundaries in either mode. Encoded values are tested before applying band placement or pixel offsets. __Default value:__"intersect".param (str) – Name of an interval selection parameter that provides the domain. The name resolves from the view that owns the scale resolution.
source (Literal['viewport']) – Derives the domain from data in the current positional viewport. The domain is updated shortly after navigation pauses. Normal data-derived domain options, such as
zeroandnice, still apply.
- domainMax(value)View on GitHub¶
Return a copy with
domainMaxupdated.
- domainMid(value)View on GitHub¶
Return a copy with
domainMidupdated.
- domainMin(value)View on GitHub¶
Return a copy with
domainMinupdated.
- domainTransition(value)View on GitHub¶
Return a copy with
domainTransitionupdated.
- exponent(value)View on GitHub¶
Return a copy with
exponentupdated.
- gapPositions(value=Undefined, /, *, expr=Undefined)View on GitHub¶
Return a copy with a
ExprRefgapPositions.- Parameters:
expr (str) – The expression string.
- gapWidth(value=Undefined, /, *, expr=Undefined)View on GitHub¶
Return a copy with a
ExprRefgapWidth.- Parameters:
expr (str) – The expression string.
- interpolate(value=Undefined, /, *, gamma=Undefined, type=Undefined)View on GitHub¶
Return a copy with
interpolateupdated.- Parameters:
gamma (float) – Schema-defined
gammaproperty.type (Literal['rgb', 'cubehelix', 'cubehelix-long']) – Schema-defined
typeproperty.
- name(value)View on GitHub¶
Return a copy with
nameupdated.
- nice(value=Undefined, /, *, interval=Undefined, step=Undefined)View on GitHub¶
Return a copy with
niceupdated.
- numberingOffset(value)View on GitHub¶
Return a copy with
numberingOffsetupdated.
- padding(value)View on GitHub¶
Return a copy with
paddingupdated.
- paddingInner(value)View on GitHub¶
Return a copy with
paddingInnerupdated.
- paddingOuter(value)View on GitHub¶
Return a copy with
paddingOuterupdated.
- range(value)View on GitHub¶
Return a copy with
rangeupdated.
- reverse(value)View on GitHub¶
Return a copy with
reverseupdated.
- round(value)View on GitHub¶
Return a copy with
roundupdated.
- scheme(value=Undefined, /, *, count=Undefined, extent=Undefined, name=Undefined)View on GitHub¶
Return a copy with a
SchemeParamsscheme.- Parameters:
count (float) – The number of colors to use in the scheme. This can be useful for scale types such as
"quantize", which use the length of the scale range to determine the number of discrete bins for the scale domain.extent (Sequence[float]) – The extent of the color range to use. For example
[0.2, 1]will rescale the color scheme such that color values in the range [0, 0.2) are excluded from the scheme.name (str) – A color scheme name for ordinal scales (e.g.,
"category10"or"blues"). For the full list of supported schemes, please refer to the Vega Scheme reference.
- type(value)View on GitHub¶
Return a copy with
typeupdated.
- viewport(value)View on GitHub¶
Return a copy with
viewportupdated.
- zero(value)View on GitHub¶
Return a copy with
zeroupdated.
- zoom(value=Undefined, /, *, extent=Undefined)View on GitHub¶
Return a copy with a
ZoomParamszoom.- Parameters:
extent (ScalarDomain_T | Sequence[ChromosomalLocus | dict[str, Any]] | Literal['data'] | Literal['unbounded']) – The boundaries that limit zoom and pan interactions on continuous scales. Band and point scales use the full categorical domain as their bounds and accept only a boolean
zoomproperty. A domain array sets explicit boundaries."data"derives the boundaries from the data that contributes to the scale domain. For index and quantitative scales,"unbounded"allows zooming and panning without fixed boundaries. Locus scales do not support unbounded zoom. With an unbounded extent, the initial scale domain is used as the reference for thezoomLevel()expression helper and its channel-specific form, such aszoomLevel("x"). __Default value:__ The initial scale domain, except the whole genome for locus scales.
- copy(*, deep=True, **kwds)View on GitHub¶
Return a copy with optional keyword updates.
- classmethod resolve_references()View on GitHub¶
Return this class schema with referenced properties merged in.
- to_dict(*, validate=True)View on GitHub¶
Serialize this schema wrapper to a JSON-compatible dictionary.
- to_json(*, validate=True)View on GitHub¶
Serialize this schema wrapper to formatted JSON.
- classmethod validate(instance)View on GitHub¶
Validate an instance against this wrapper’s schema.