genome_spy.Encoding

class genome_spy.Encoding(angle=Undefined, color=Undefined, direction=Undefined, dx=Undefined, dy=Undefined, facetIndex=Undefined, fill=Undefined, fillOpacity=Undefined, key=Undefined, opacity=Undefined, order=Undefined, sample=Undefined, search=Undefined, semanticScore=Undefined, shape=Undefined, size=Undefined, stroke=Undefined, strokeOpacity=Undefined, strokeWidth=Undefined, text=Undefined, tooltip=Undefined, uniqueId=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds)View on GitHub

Bases: GenomeSpySchema

Generated wrapper for Encoding.

Methods

angle([value, band, condition, datum, ...])

Return a copy with angle updated.

color([value, band, condition, datum, ...])

Return a copy with color updated.

copy(*[, deep])

Return a copy with optional keyword updates.

direction([value, band, datum, description, ...])

Return a copy with a DirectionDef direction.

dx([value, band, condition, datum, ...])

Return a copy with dx updated.

dy([value, band, condition, datum, ...])

Return a copy with dy updated.

facetIndex([value, description, field, title])

Return a copy with a FieldDefWithoutScale facetIndex.

fill([value, band, condition, datum, ...])

Return a copy with fill updated.

fillOpacity([value, band, condition, datum, ...])

Return a copy with fillOpacity updated.

key([value, description, field, title])

Return a copy with key updated.

opacity([value, band, condition, datum, ...])

Return a copy with opacity updated.

order([value, condition])

Return a copy with a OrderDef order.

resolve_references()

Return this class schema with referenced properties merged in.

sample([value, description, field, title])

Return a copy with a FieldDefWithoutScale sample.

search([value, description, field, title])

Return a copy with search updated.

semanticScore([value, description, field, ...])

Return a copy with semanticScore updated.

shape([value, band, condition, datum, ...])

Return a copy with shape updated.

size([value, band, condition, datum, ...])

Return a copy with size updated.

stroke([value, band, condition, datum, ...])

Return a copy with stroke updated.

strokeOpacity([value, band, condition, ...])

Return a copy with strokeOpacity updated.

strokeWidth([value, band, condition, datum, ...])

Return a copy with strokeWidth updated.

text([value, band, datum, description, ...])

Return a copy with text updated.

to_dict(*[, validate])

Serialize this schema wrapper to a JSON-compatible dictionary.

to_json(*[, validate])

Serialize this schema wrapper to formatted JSON.

tooltip([value, band, datum, description, ...])

Return a copy with tooltip updated.

uniqueId([value, description, field, title])

Return a copy with a FieldDefWithoutScale uniqueId.

validate(instance)

Validate an instance against this wrapper's schema.

x([value, axis, band, buildIndex, chrom, ...])

Return a copy with x updated.

x2([value, axis, band, chrom, datum, ...])

Return a copy with a Position2Def x2.

x2Offset([value, band, datum, description, ...])

Return a copy with a SecondaryOffsetDef x2Offset.

xOffset([value, band, condition, datum, ...])

Return a copy with xOffset updated.

y([value, axis, band, chrom, datum, ...])

Return a copy with y updated.

y2([value, axis, band, chrom, datum, ...])

Return a copy with a Position2Def y2.

y2Offset([value, band, datum, description, ...])

Return a copy with a SecondaryOffsetDef y2Offset.

yOffset([value, band, condition, datum, ...])

Return a copy with yOffset updated.

angle(value=Undefined, /, *, band=Undefined, condition=Undefined, datum=Undefined, description=Undefined, domainInert=Undefined, expr=Undefined, field=Undefined, format=Undefined, legend=Undefined, resolutionChannel=Undefined, scale=Undefined, title=Undefined, type=Undefined)View on GitHub

Return a copy with angle updated.

Parameters:
color(value=Undefined, /, *, band=Undefined, condition=Undefined, datum=Undefined, description=Undefined, domainInert=Undefined, expr=Undefined, field=Undefined, format=Undefined, legend=Undefined, resolutionChannel=Undefined, scale=Undefined, title=Undefined, type=Undefined)View on GitHub

Return a copy with color updated.

Parameters:
direction(value=Undefined, /, *, band=Undefined, datum=Undefined, description=Undefined, domainInert=Undefined, field=Undefined, format=Undefined, resolutionChannel=Undefined, scale=Undefined, title=Undefined, type=Undefined)View on GitHub

Return a copy with a DirectionDef direction.

Parameters:
  • band (float) – Relative position on band scale. For example, the marks will be positioned at the beginning of the band if set to 0, and at the middle of the band if set to 0.5.

  • datum (Scalar_T | ExprRef | dict[str, Any]) – A constant value in data domain.

  • description (str) – A description of the encoded value. Can be used for documentation and to explain the meaning of the channel mapping.

  • domainInert (bool) – Whether the field or evaluated expr should be excluded from the scale’s domain. Prefer the view-level domainInert when an entire subtree should be excluded. Default value: false

  • field (str) – __Required.__ A string defining the name of the field from which to pull a data value. __See also:__ field documentation. __Notes:__ 1) Dots (.) and brackets ([ and ]) can be used to access nested objects (e.g., "field": "foo.bar" and "field": "foo['bar']"). If field names contain dots or brackets but are not nested, you can use \ to escape dots and brackets (e.g., "a\.b" and "a\[0\]"). See more details about escaping in the Vega-Lite field documentation.

  • format (str) – When used with the default "number" format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks. - If the format type is "number" (e.g., for quantitative fields), this is D3’s number format pattern. See the Vega-Lite format documentation for more examples.

  • resolutionChannel (ChannelWithScale_T) – An alternative channel for scale resolution. This is mainly for internal use and allows using color channel to resolve fill and stroke channels under certain circumstances.

  • scale (Scale | ScaleKwds | None) – An object defining properties of the channel’s scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. If null, the scale will be disabled and the data value will be directly encoded. __Default value:__ If undefined, default scale properties are applied. __See also:__ scale documentation.

  • title (str | None) – A title for the field. If null, the title will be removed.

  • type (Type_T) – Schema-defined type property.

dx(value=Undefined, /, *, band=Undefined, condition=Undefined, datum=Undefined, description=Undefined, domainInert=Undefined, expr=Undefined, field=Undefined, format=Undefined, legend=Undefined, resolutionChannel=Undefined, scale=Undefined, title=Undefined, type=Undefined)View on GitHub

Return a copy with dx updated.

Parameters:
dy(value=Undefined, /, *, band=Undefined, condition=Undefined, datum=Undefined, description=Undefined, domainInert=Undefined, expr=Undefined, field=Undefined, format=Undefined, legend=Undefined, resolutionChannel=Undefined, scale=Undefined, title=Undefined, type=Undefined)View on GitHub

Return a copy with dy updated.

Parameters:
facetIndex(value=Undefined, /, *, description=Undefined, field=Undefined, title=Undefined)View on GitHub

Return a copy with a FieldDefWithoutScale facetIndex.

Parameters:
  • description (str) – A description of the encoded field. Can be used for documentation and to explain the meaning of the channel mapping.

  • field (str) – __Required.__ A string defining the name of the field from which to pull a data value. __See also:__ field documentation. __Notes:__ 1) Dots (.) and brackets ([ and ]) can be used to access nested objects (e.g., "field": "foo.bar" and "field": "foo['bar']"). If field names contain dots or brackets but are not nested, you can use \ to escape dots and brackets (e.g., "a\.b" and "a\[0\]"). See more details about escaping in the Vega-Lite field documentation.

  • title (str | None) – A title for the field. If null, the title will be removed.

fill(value=Undefined, /, *, band=Undefined, condition=Undefined, datum=Undefined, description=Undefined, domainInert=Undefined, expr=Undefined, field=Undefined, format=Undefined, legend=Undefined, resolutionChannel=Undefined, scale=Undefined, title=Undefined, type=Undefined)View on GitHub

Return a copy with fill updated.

Parameters:
fillOpacity(value=Undefined, /, *, band=Undefined, condition=Undefined, datum=Undefined, description=Undefined, domainInert=Undefined, expr=Undefined, field=Undefined, format=Undefined, legend=Undefined, resolutionChannel=Undefined, scale=Undefined, title=Undefined, type=Undefined)View on GitHub

Return a copy with fillOpacity updated.

Parameters:
key(value=Undefined, /, *, description=Undefined, field=Undefined, title=Undefined)View on GitHub

Return a copy with key updated.

Parameters:
  • description (str) – A description of the encoded field. Can be used for documentation and to explain the meaning of the channel mapping.

  • field (str) – __Required.__ A string defining the name of the field from which to pull a data value. __See also:__ field documentation. __Notes:__ 1) Dots (.) and brackets ([ and ]) can be used to access nested objects (e.g., "field": "foo.bar" and "field": "foo['bar']"). If field names contain dots or brackets but are not nested, you can use \ to escape dots and brackets (e.g., "a\.b" and "a\[0\]"). See more details about escaping in the Vega-Lite field documentation.

  • title (str | None) – A title for the field. If null, the title will be removed.

opacity(value=Undefined, /, *, band=Undefined, condition=Undefined, datum=Undefined, description=Undefined, domainInert=Undefined, expr=Undefined, field=Undefined, format=Undefined, legend=Undefined, resolutionChannel=Undefined, scale=Undefined, title=Undefined, type=Undefined)View on GitHub

Return a copy with opacity updated.

Parameters:
order(value=Undefined, /, *, condition=Undefined)View on GitHub

Return a copy with a OrderDef order.

Parameters:

condition (OrderCondition | dict[str, Any]) – Selection condition that determines the matching level.

sample(value=Undefined, /, *, description=Undefined, field=Undefined, title=Undefined)View on GitHub

Return a copy with a FieldDefWithoutScale sample.

Parameters:
  • description (str) – A description of the encoded field. Can be used for documentation and to explain the meaning of the channel mapping.

  • field (str) – __Required.__ A string defining the name of the field from which to pull a data value. __See also:__ field documentation. __Notes:__ 1) Dots (.) and brackets ([ and ]) can be used to access nested objects (e.g., "field": "foo.bar" and "field": "foo['bar']"). If field names contain dots or brackets but are not nested, you can use \ to escape dots and brackets (e.g., "a\.b" and "a\[0\]"). See more details about escaping in the Vega-Lite field documentation.

  • title (str | None) – A title for the field. If null, the title will be removed.

search(value=Undefined, /, *, description=Undefined, field=Undefined, title=Undefined)View on GitHub

Return a copy with search updated.

Parameters:
  • description (str) – A description of the encoded field. Can be used for documentation and to explain the meaning of the channel mapping.

  • field (str) – __Required.__ A string defining the name of the field from which to pull a data value. __See also:__ field documentation. __Notes:__ 1) Dots (.) and brackets ([ and ]) can be used to access nested objects (e.g., "field": "foo.bar" and "field": "foo['bar']"). If field names contain dots or brackets but are not nested, you can use \ to escape dots and brackets (e.g., "a\.b" and "a\[0\]"). See more details about escaping in the Vega-Lite field documentation.

  • title (str | None) – A title for the field. If null, the title will be removed.

semanticScore(value=Undefined, /, *, description=Undefined, field=Undefined, title=Undefined, type=Undefined)View on GitHub

Return a copy with semanticScore updated.

Parameters:
  • description (str) – A description of the encoded field. Can be used for documentation and to explain the meaning of the channel mapping.

  • field (str) – __Required.__ A string defining the name of the field from which to pull a data value. __See also:__ field documentation. __Notes:__ 1) Dots (.) and brackets ([ and ]) can be used to access nested objects (e.g., "field": "foo.bar" and "field": "foo['bar']"). If field names contain dots or brackets but are not nested, you can use \ to escape dots and brackets (e.g., "a\.b" and "a\[0\]"). See more details about escaping in the Vega-Lite field documentation.

  • title (str | None) – A title for the field. If null, the title will be removed.

  • type (Type_T) – Schema-defined type property.

shape(value=Undefined, /, *, band=Undefined, condition=Undefined, datum=Undefined, description=Undefined, domainInert=Undefined, expr=Undefined, field=Undefined, format=Undefined, legend=Undefined, resolutionChannel=Undefined, scale=Undefined, title=Undefined, type=Undefined)View on GitHub

Return a copy with shape updated.

Parameters:
size(value=Undefined, /, *, band=Undefined, condition=Undefined, datum=Undefined, description=Undefined, domainInert=Undefined, expr=Undefined, field=Undefined, format=Undefined, legend=Undefined, resolutionChannel=Undefined, scale=Undefined, title=Undefined, type=Undefined)View on GitHub

Return a copy with size updated.

Parameters:
stroke(value=Undefined, /, *, band=Undefined, condition=Undefined, datum=Undefined, description=Undefined, domainInert=Undefined, expr=Undefined, field=Undefined, format=Undefined, legend=Undefined, resolutionChannel=Undefined, scale=Undefined, title=Undefined, type=Undefined)View on GitHub

Return a copy with stroke updated.

Parameters:
strokeOpacity(value=Undefined, /, *, band=Undefined, condition=Undefined, datum=Undefined, description=Undefined, domainInert=Undefined, expr=Undefined, field=Undefined, format=Undefined, legend=Undefined, resolutionChannel=Undefined, scale=Undefined, title=Undefined, type=Undefined)View on GitHub

Return a copy with strokeOpacity updated.

Parameters:
strokeWidth(value=Undefined, /, *, band=Undefined, condition=Undefined, datum=Undefined, description=Undefined, domainInert=Undefined, expr=Undefined, field=Undefined, format=Undefined, legend=Undefined, resolutionChannel=Undefined, scale=Undefined, title=Undefined, type=Undefined)View on GitHub

Return a copy with strokeWidth updated.

Parameters:
text(value=Undefined, /, *, band=Undefined, datum=Undefined, description=Undefined, domainInert=Undefined, expr=Undefined, field=Undefined, format=Undefined, resolutionChannel=Undefined, scale=Undefined, title=Undefined, type=Undefined)View on GitHub

Return a copy with text updated.

Parameters:
  • band (float) – Schema-defined band property.

  • datum (Scalar_T | ExprRef | dict[str, Any]) – A constant value in data domain.

  • description (str) – Schema-defined description property.

  • domainInert (bool) – Whether the field or evaluated expr should be excluded from the scale’s domain. Prefer the view-level domainInert when an entire subtree should be excluded. Default value: false

  • expr (str) – An expression. Properties of the data can be accessed through the datum object.

  • field (str) – Schema-defined field property.

  • format (str) – Schema-defined format property.

  • resolutionChannel (ChannelWithScale_T) – An alternative channel for scale resolution. This is mainly for internal use and allows using color channel to resolve fill and stroke channels under certain circumstances.

  • scale (Scale | ScaleKwds | None) – An object defining properties of the channel’s scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. If null, the scale will be disabled and the data value will be directly encoded. __Default value:__ If undefined, default scale properties are applied. __See also:__ scale documentation.

  • title (str | None) – Schema-defined title property.

  • type (Type_T) – Schema-defined type property.

tooltip(value=Undefined, /, *, band=Undefined, datum=Undefined, description=Undefined, domainInert=Undefined, expr=Undefined, field=Undefined, format=Undefined, resolutionChannel=Undefined, scale=Undefined, title=Undefined, type=Undefined)View on GitHub

Return a copy with tooltip updated.

Parameters:
  • band (float) – Schema-defined band property.

  • datum (Scalar_T | ExprRef | dict[str, Any]) – A constant value in data domain.

  • description (str) – Schema-defined description property.

  • domainInert (bool) – Whether the field or evaluated expr should be excluded from the scale’s domain. Prefer the view-level domainInert when an entire subtree should be excluded. Default value: false

  • expr (str) – An expression. Properties of the data can be accessed through the datum object.

  • field (str) – Schema-defined field property.

  • format (str) – Schema-defined format property.

  • resolutionChannel (ChannelWithScale_T) – An alternative channel for scale resolution. This is mainly for internal use and allows using color channel to resolve fill and stroke channels under certain circumstances.

  • scale (Scale | ScaleKwds | None) – An object defining properties of the channel’s scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. If null, the scale will be disabled and the data value will be directly encoded. __Default value:__ If undefined, default scale properties are applied. __See also:__ scale documentation.

  • title (str | None) – Schema-defined title property.

  • type (Type_T) – Schema-defined type property.

uniqueId(value=Undefined, /, *, description=Undefined, field=Undefined, title=Undefined)View on GitHub

Return a copy with a FieldDefWithoutScale uniqueId.

Parameters:
  • description (str) – A description of the encoded field. Can be used for documentation and to explain the meaning of the channel mapping.

  • field (str) – __Required.__ A string defining the name of the field from which to pull a data value. __See also:__ field documentation. __Notes:__ 1) Dots (.) and brackets ([ and ]) can be used to access nested objects (e.g., "field": "foo.bar" and "field": "foo['bar']"). If field names contain dots or brackets but are not nested, you can use \ to escape dots and brackets (e.g., "a\.b" and "a\[0\]"). See more details about escaping in the Vega-Lite field documentation.

  • title (str | None) – A title for the field. If null, the title will be removed.

x(value=Undefined, /, *, axis=Undefined, band=Undefined, buildIndex=Undefined, chrom=Undefined, datum=Undefined, description=Undefined, domainInert=Undefined, expr=Undefined, field=Undefined, offset=Undefined, pos=Undefined, resolutionChannel=Undefined, scale=Undefined, title=Undefined, type=Undefined)View on GitHub

Return a copy with x updated.

Parameters:
  • axis (GenomeAxis | GenomeAxisKwds | None) – Schema-defined axis property.

  • band (float) – Schema-defined band property.

  • buildIndex (bool) – Schema-defined buildIndex property.

  • chrom (FieldName_T) – The field having the chromosome or contig.

  • datum (Scalar_T | ExprRef | dict[str, Any]) – A constant value in data domain.

  • description (str) – Schema-defined description property.

  • domainInert (bool) – Schema-defined domainInert property.

  • expr (str) – An expression. Properties of the data can be accessed through the datum object.

  • field (str) – __Required.__ A string defining the name of the field from which to pull a data value. __See also:__ field documentation. __Notes:__ 1) Dots (.) and brackets ([ and ]) can be used to access nested objects (e.g., "field": "foo.bar" and "field": "foo['bar']"). If field names contain dots or brackets but are not nested, you can use \ to escape dots and brackets (e.g., "a\.b" and "a\[0\]"). See more details about escaping in the Vega-Lite field documentation.

  • offset (float) – An offset or offsets that allow for adjusting the numbering base. The offset is subtracted from the positions. GenomeSpy uses internally zero-based indexing with half-open intervals. UCSC-based formats (BED, etc.) generally use this scheme. However, for example, VCF files use one-based indexing and must be adjusted by setting the offset to 1. Default: 0

  • pos (FieldName_T) – The field having an intra-chromosomal position.

  • resolutionChannel (ChannelWithScale_T) – Schema-defined resolutionChannel property.

  • scale (Scale | ScaleKwds | None) – Schema-defined scale property.

  • title (str | None) – Schema-defined title property.

  • type (Type_T | Literal['locus']) – Schema-defined type property.

x2(value=Undefined, /, *, axis=Undefined, band=Undefined, chrom=Undefined, datum=Undefined, description=Undefined, domainInert=Undefined, expr=Undefined, field=Undefined, offset=Undefined, pos=Undefined, resolutionChannel=Undefined, scale=Undefined, title=Undefined, type=Undefined)View on GitHub

Return a copy with a Position2Def x2.

Parameters:
  • axis (GenomeAxis | GenomeAxisKwds | None) – An object defining properties of axis’s gridlines, ticks and labels. If null, the axis for the encoding channel will be removed. __Default value:__ If undefined, default axis properties are applied. __See also:__ axis documentation.

  • band (float) – Relative position on band scale. For example, the marks will be positioned at the beginning of the band if set to 0, and at the middle of the band if set to 0.5.

  • chrom (FieldName_T) – The field having the chromosome or contig.

  • datum (Scalar_T | ExprRef | dict[str, Any]) – A constant value in data domain.

  • description (str) – A description of the encoded value. Can be used for documentation and to explain the meaning of the channel mapping.

  • domainInert (bool) – Whether the field or evaluated expr should be excluded from the scale’s domain. Prefer the view-level domainInert when an entire subtree should be excluded. Default value: false

  • expr (str) – An expression. Properties of the data can be accessed through the datum object.

  • field (str) – __Required.__ A string defining the name of the field from which to pull a data value. __See also:__ field documentation. __Notes:__ 1) Dots (.) and brackets ([ and ]) can be used to access nested objects (e.g., "field": "foo.bar" and "field": "foo['bar']"). If field names contain dots or brackets but are not nested, you can use \ to escape dots and brackets (e.g., "a\.b" and "a\[0\]"). See more details about escaping in the Vega-Lite field documentation.

  • offset (float) – An offset or offsets that allow for adjusting the numbering base. The offset is subtracted from the positions. GenomeSpy uses internally zero-based indexing with half-open intervals. UCSC-based formats (BED, etc.) generally use this scheme. However, for example, VCF files use one-based indexing and must be adjusted by setting the offset to 1. Default: 0

  • pos (FieldName_T) – The field having an intra-chromosomal position.

  • resolutionChannel (ChannelWithScale_T) – An alternative channel for scale resolution. This is mainly for internal use and allows using color channel to resolve fill and stroke channels under certain circumstances.

  • scale (Scale | ScaleKwds | None) – An object defining properties of the channel’s scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. If null, the scale will be disabled and the data value will be directly encoded. __Default value:__ If undefined, default scale properties are applied. __See also:__ scale documentation.

  • title (str | None) – A title for the field. If null, the title will be removed.

  • type (Type_T) – Schema-defined type property.

x2Offset(value=Undefined, /, *, band=Undefined, datum=Undefined, description=Undefined, domainInert=Undefined, expr=Undefined, field=Undefined, title=Undefined, type=Undefined)View on GitHub

Return a copy with a SecondaryOffsetDef x2Offset.

Parameters:
  • band (float) – Relative position on band scale. For example, the marks will be positioned at the beginning of the band if set to 0, and at the middle of the band if set to 0.5.

  • datum (Scalar_T | ExprRef | dict[str, Any]) – A constant value in data domain.

  • description (str) – A description of the encoded value. Can be used for documentation and to explain the meaning of the channel mapping.

  • domainInert (bool) – Whether the field or evaluated expr should be excluded from the scale’s domain. Prefer the view-level domainInert when an entire subtree should be excluded. Default value: false

  • expr (str) – An expression. Properties of the data can be accessed through the datum object.

  • field (str) – __Required.__ A string defining the name of the field from which to pull a data value. __See also:__ field documentation. __Notes:__ 1) Dots (.) and brackets ([ and ]) can be used to access nested objects (e.g., "field": "foo.bar" and "field": "foo['bar']"). If field names contain dots or brackets but are not nested, you can use \ to escape dots and brackets (e.g., "a\.b" and "a\[0\]"). See more details about escaping in the Vega-Lite field documentation.

  • title (str | None) – A title for the field. If null, the title will be removed.

  • type (Type_T) – Schema-defined type property.

xOffset(value=Undefined, /, *, band=Undefined, condition=Undefined, datum=Undefined, description=Undefined, domainInert=Undefined, expr=Undefined, field=Undefined, format=Undefined, legend=Undefined, resolutionChannel=Undefined, scale=Undefined, title=Undefined, type=Undefined)View on GitHub

Return a copy with xOffset updated.

Parameters:
y(value=Undefined, /, *, axis=Undefined, band=Undefined, chrom=Undefined, datum=Undefined, description=Undefined, domainInert=Undefined, expr=Undefined, field=Undefined, offset=Undefined, pos=Undefined, resolutionChannel=Undefined, scale=Undefined, title=Undefined, type=Undefined)View on GitHub

Return a copy with y updated.

Parameters:
  • axis (GenomeAxis | GenomeAxisKwds | None) – Schema-defined axis property.

  • band (float) – Schema-defined band property.

  • chrom (FieldName_T) – The field having the chromosome or contig.

  • datum (Scalar_T | ExprRef | dict[str, Any]) – A constant value in data domain.

  • description (str) – Schema-defined description property.

  • domainInert (bool) – Schema-defined domainInert property.

  • expr (str) – An expression. Properties of the data can be accessed through the datum object.

  • field (str) – __Required.__ A string defining the name of the field from which to pull a data value. __See also:__ field documentation. __Notes:__ 1) Dots (.) and brackets ([ and ]) can be used to access nested objects (e.g., "field": "foo.bar" and "field": "foo['bar']"). If field names contain dots or brackets but are not nested, you can use \ to escape dots and brackets (e.g., "a\.b" and "a\[0\]"). See more details about escaping in the Vega-Lite field documentation.

  • offset (float) – An offset or offsets that allow for adjusting the numbering base. The offset is subtracted from the positions. GenomeSpy uses internally zero-based indexing with half-open intervals. UCSC-based formats (BED, etc.) generally use this scheme. However, for example, VCF files use one-based indexing and must be adjusted by setting the offset to 1. Default: 0

  • pos (FieldName_T) – The field having an intra-chromosomal position.

  • resolutionChannel (ChannelWithScale_T) – Schema-defined resolutionChannel property.

  • scale (Scale | ScaleKwds | None) – Schema-defined scale property.

  • title (str | None) – Schema-defined title property.

  • type (Type_T | Literal['locus']) – Schema-defined type property.

y2(value=Undefined, /, *, axis=Undefined, band=Undefined, chrom=Undefined, datum=Undefined, description=Undefined, domainInert=Undefined, expr=Undefined, field=Undefined, offset=Undefined, pos=Undefined, resolutionChannel=Undefined, scale=Undefined, title=Undefined, type=Undefined)View on GitHub

Return a copy with a Position2Def y2.

Parameters:
  • axis (GenomeAxis | GenomeAxisKwds | None) – An object defining properties of axis’s gridlines, ticks and labels. If null, the axis for the encoding channel will be removed. __Default value:__ If undefined, default axis properties are applied. __See also:__ axis documentation.

  • band (float) – Relative position on band scale. For example, the marks will be positioned at the beginning of the band if set to 0, and at the middle of the band if set to 0.5.

  • chrom (FieldName_T) – The field having the chromosome or contig.

  • datum (Scalar_T | ExprRef | dict[str, Any]) – A constant value in data domain.

  • description (str) – A description of the encoded value. Can be used for documentation and to explain the meaning of the channel mapping.

  • domainInert (bool) – Whether the field or evaluated expr should be excluded from the scale’s domain. Prefer the view-level domainInert when an entire subtree should be excluded. Default value: false

  • expr (str) – An expression. Properties of the data can be accessed through the datum object.

  • field (str) – __Required.__ A string defining the name of the field from which to pull a data value. __See also:__ field documentation. __Notes:__ 1) Dots (.) and brackets ([ and ]) can be used to access nested objects (e.g., "field": "foo.bar" and "field": "foo['bar']"). If field names contain dots or brackets but are not nested, you can use \ to escape dots and brackets (e.g., "a\.b" and "a\[0\]"). See more details about escaping in the Vega-Lite field documentation.

  • offset (float) – An offset or offsets that allow for adjusting the numbering base. The offset is subtracted from the positions. GenomeSpy uses internally zero-based indexing with half-open intervals. UCSC-based formats (BED, etc.) generally use this scheme. However, for example, VCF files use one-based indexing and must be adjusted by setting the offset to 1. Default: 0

  • pos (FieldName_T) – The field having an intra-chromosomal position.

  • resolutionChannel (ChannelWithScale_T) – An alternative channel for scale resolution. This is mainly for internal use and allows using color channel to resolve fill and stroke channels under certain circumstances.

  • scale (Scale | ScaleKwds | None) – An object defining properties of the channel’s scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. If null, the scale will be disabled and the data value will be directly encoded. __Default value:__ If undefined, default scale properties are applied. __See also:__ scale documentation.

  • title (str | None) – A title for the field. If null, the title will be removed.

  • type (Type_T) – Schema-defined type property.

y2Offset(value=Undefined, /, *, band=Undefined, datum=Undefined, description=Undefined, domainInert=Undefined, expr=Undefined, field=Undefined, title=Undefined, type=Undefined)View on GitHub

Return a copy with a SecondaryOffsetDef y2Offset.

Parameters:
  • band (float) – Relative position on band scale. For example, the marks will be positioned at the beginning of the band if set to 0, and at the middle of the band if set to 0.5.

  • datum (Scalar_T | ExprRef | dict[str, Any]) – A constant value in data domain.

  • description (str) – A description of the encoded value. Can be used for documentation and to explain the meaning of the channel mapping.

  • domainInert (bool) – Whether the field or evaluated expr should be excluded from the scale’s domain. Prefer the view-level domainInert when an entire subtree should be excluded. Default value: false

  • expr (str) – An expression. Properties of the data can be accessed through the datum object.

  • field (str) – __Required.__ A string defining the name of the field from which to pull a data value. __See also:__ field documentation. __Notes:__ 1) Dots (.) and brackets ([ and ]) can be used to access nested objects (e.g., "field": "foo.bar" and "field": "foo['bar']"). If field names contain dots or brackets but are not nested, you can use \ to escape dots and brackets (e.g., "a\.b" and "a\[0\]"). See more details about escaping in the Vega-Lite field documentation.

  • title (str | None) – A title for the field. If null, the title will be removed.

  • type (Type_T) – Schema-defined type property.

yOffset(value=Undefined, /, *, band=Undefined, condition=Undefined, datum=Undefined, description=Undefined, domainInert=Undefined, expr=Undefined, field=Undefined, format=Undefined, legend=Undefined, resolutionChannel=Undefined, scale=Undefined, title=Undefined, type=Undefined)View on GitHub

Return a copy with yOffset updated.

Parameters:
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.