genome_spy.DataSource

class genome_spy.DataSource(description=Undefined, dynamicCallbackSource=Undefined, format=Undefined, lazy=Undefined, name=Undefined, url=Undefined, values=Undefined, **kwds)View on GitHub

Bases: GenomeSpySchema

Generated wrapper for DataSource.

Methods

copy(*[, deep])

Return a copy with optional keyword updates.

description(value)

Return a copy with description updated.

dynamicCallbackSource(value)

Return a copy with dynamicCallbackSource updated.

format([value, columns, delimiter, parse, ...])

Return a copy with format updated.

lazy([value, addChrPrefix, axis, channel, ...])

Return a copy with a LazyDataParams lazy.

name(value)

Return a copy with name updated.

resolve_references()

Return this class schema with referenced properties merged in.

to_dict(*[, validate])

Serialize this schema wrapper to a JSON-compatible dictionary.

to_json(*[, validate])

Serialize this schema wrapper to formatted JSON.

url([value, attach, expr, field, maxValues, ...])

Return a copy with url updated.

validate(instance)

Validate an instance against this wrapper's schema.

values([value])

Return a copy with a InlineDataset values.

description(value)View on GitHub

Return a copy with description updated.

dynamicCallbackSource(value)View on GitHub

Return a copy with dynamicCallbackSource updated.

format(value=Undefined, /, *, columns=Undefined, delimiter=Undefined, parse=Undefined, property=Undefined, type=Undefined)View on GitHub

Return a copy with format updated.

Parameters:
  • columns (Sequence[str]) – Schema-defined columns property.

  • delimiter (str) – The delimiter between records. The delimiter must be a single character (i.e., a single 16-bit code unit); so, ASCII delimiters are fine, but emoji delimiters are not.

  • parse (Parse | ParseKwds | None) – Schema-defined parse property.

  • property (str) – The JSON property containing the desired data. This parameter can be used when the loaded JSON file may have surrounding structure or meta-data. For example "property": "values.features" is equivalent to retrieving json.values.features from the loaded JSON object.

  • type (Literal['csv', 'tsv'] | Literal['dsv'] | Literal['json'] | Literal['bed'] | Literal['bedpe'] | Literal['wig'] | Literal['vcf'] | str) – Schema-defined type property.

lazy(value=Undefined, /, *, addChrPrefix=Undefined, axis=Undefined, channel=Undefined, channels=Undefined, columns=Undefined, count=Undefined, dataType=Undefined, debounce=Undefined, debounceDomainChange=Undefined, debounceMode=Undefined, format=Undefined, indexUrl=Undefined, maxSummaryPixels=Undefined, mode=Undefined, parse=Undefined, pixelsPerBin=Undefined, sizeMode=Undefined, tags=Undefined, tracks=Undefined, type=Undefined, url=Undefined, values=Undefined, windowSize=Undefined)View on GitHub

Return a copy with a LazyDataParams lazy.

Parameters:
  • addChrPrefix (bool | str) – Add a chr (boolean) or custom (string) prefix to the chromosome names in the Tabix file. __Default value:__ false

  • axis (Axis | AxisKwds) – Optional axis properties

  • channel (PrimaryPositionalChannel_T) – Which channel’s scale domain to monitor. __Default value:__ "x"

  • channels (Sequence[Literal['x', 'y']]) – One or both positional channels, without duplicates. Each contributes xGroup, xStart, xEnd or the corresponding y fields. Two channels produce their Cartesian product. Index/locus endpoints are half-open numeric intervals. Band/point endpoints are category values at the outer edges of each group. Reversing the range swaps these categories. Use band: 0 for Start and band: 1 for End. Point groups span their centers. Guide views should share the data-bearing view’s scales and set domainInert: true.

  • columns (Sequence[str]) – Ordered list of field names for headerless tabix TSV input. If omitted, the source tries to read a commented header line from the tabix file header or the first row of a plain TSV header.

  • count (float) – Number of ticks to generate

  • dataType (Type_T) – The data type of the source channel

  • debounce (float | ExprRef | dict[str, Any]) – Debounce time for data updates, in milliseconds. Debouncing prevents excessive data updates when the user is zooming or panning around. __Default value:__ 200

  • debounceDomainChange (float | ExprRef | dict[str, Any]) – Debounce time for scale-domain driven data updates, in milliseconds. __Default value:__ 200

  • debounceMode (Literal['domain', 'window']) – The debounce mode for data updates. If set to "domain", domain change events (panning and zooming) will be debounced. If set to "window", the data fetches initiated by the changes to the visible window (or tile) will be debounced. If your data is small, the "window" is better as it will start fetching data while the user is still panning around, resulting in a shorter perceived latency. __Default value:__ "window"

  • format (str) – D3 number format specifier for tick labels

  • indexUrl (str | ExprRef | dict[str, Any] | IndexUrlTemplate) – URL of the tabix index file. When url is a template, this can be an index URL template using the same placeholder and values. __Default value:__ url + ".tbi".

  • maxSummaryPixels (float | ExprRef | dict[str, Any]) – Maximum screen width of the finest summary bin when fast mode would otherwise request finer raw bins. Must be nonnegative. Larger values keep summaries in use closer to the data, reducing reads while smoothing smaller features. Set to zero to require summaries to meet the pixelsPerBin target. Coarser requested bins still follow pixelsPerBin. Does not change exact mode or raw-data binning. __Default value:__ 4

  • mode (Literal['exact'] | Literal['fast'] | ExprRef | dict[str, Any]) – Signal query mode. "fast" favors interactive browsing by using rounded summaries when their resolution meets pixelsPerBin or the finest summary fits within maxSummaryPixels. Summary bins can be coarser than requested, smoothing narrow features. NaNs contribute zero: wholly missing bins appear as zero, and partial coverage pulls means toward zero. Values and statistics derived from summary rows, including brush summaries, are approximate and can change with zoom level. If required summaries are unavailable, loading fails without a raw-data fallback. At finer zooms, fast mode uses the same raw queries and resolution as exact mode. "exact" computes bin means from raw values while omitting NaNs. Use it when missing-aware bin means are required; broad views can transfer and decode substantial raw data. Both modes emit bins, so exact mode does not make arbitrary brush-region statistics exact. __Default value:__ "fast"

  • parse (Parse | ParseKwds | None) – Optional type parsing for TSV fields. When omitted, field types are inferred automatically. Set to null to disable spec-based type inference and rely on data inference, or provide a field-to-type map to override selected columns. __Default value:__ "auto"

  • pixelsPerBin (float | ExprRef | dict[str, Any]) – Approximate minimum bin width in pixels; must be positive. Fast mode rounds coarse bin widths up to a power-of-two multiple of the file’s tile size. Finite values, including zero, are preserved. Unwritten Figwig bases are zeros; encode gaps as NaNs to preserve missingness in exact queries. __Default value:__ 2

  • sizeMode (Literal['area', 'strokeWidth']) – Whether size entries should also include the scale output as a stroke width for stroke-based legend symbols.

  • tags (Sequence[str]) – SAM auxiliary tags to expose on each read, for example ["HP", "CB"]. Each tag is available as a field named tag_ followed by the tag name, for example tag_HP. The field is undefined when a read lacks the tag. Tags that are not listed are not decoded.

  • tracks (Sequence[str] | ExprRef | dict[str, Any]) – Track names to load, or an expression returning an array of track names. Omit to load all tracks. An empty array produces empty data.

  • type (Literal['vcf']) – Schema-defined type property.

  • url (str | Sequence[str] | ExprRef | dict[str, Any] | UrlTemplate) – URL of the bgzip-compressed file. URL templates load multiple files and attach the template field to loaded rows.

  • values (Sequence[Scalar_T]) – Explicit tick values

  • windowSize (float) – Size of each chunk when fetching the Tabix file. Data is only fetched when the length of the visible domain smaller than the window size. __Default value:__ 30000000

name(value)View on GitHub

Return a copy with name updated.

url(value=Undefined, /, *, attach=Undefined, expr=Undefined, field=Undefined, maxValues=Undefined, onLoadError=Undefined, template=Undefined, type=Undefined, urlsFromFile=Undefined, values=Undefined)View on GitHub

Return a copy with url updated.

Parameters:
  • attach (bool) – Whether to attach the template value to each loaded datum using field as the datum field name. Disable this when the expanded URL identifies only a file partition and the loaded data already contains the relevant identifiers. __Default value:__ true

  • expr (str) – The expression string.

  • field (FieldName_T) – Field name used as the template placeholder and as the datum field attached to loaded rows.

  • maxValues (float) – Maximum number of distinct resolved values to load. If the limit is exceeded, the source loads no data.

  • onLoadError (Literal['error', 'skip']) – Behavior when loading an expanded URL fails. The default "error" fails the data source. Use "skip" when some expanded URLs are expected to be unavailable, for example when data files for some patients have not been generated yet. __Default value:__ "error"

  • template (str) – URL template. The value from values is substituted for the placeholder named by field, for example {sample}.

  • type (Literal['json', 'csv', 'tsv']) – The format of the data in the list. If the type is "json", the list is expected to be an array of strings. If the type is "csv" or "tsv", the list is expected to be a table with a single column named url. __Default value:__ "txt"

  • urlsFromFile (str) – A URL that returns a list of URLs to load the data set. The URLs in the list can be absolute or relative to the URL of the list.

  • values (Sequence[Scalar_T] | ExprRef | dict[str, Any]) – Values used for template expansion. Duplicate resolved URLs are loaded once. An ExprRef can reference reactive parameters such as visibleSamples.

values(value=Undefined, /)View on GitHub

Return a copy with a InlineDataset values.

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.