genome_spy.data.LazyNamespace

class genome_spy.data.LazyNamespaceView on GitHub

Bases: LazyDataMethodMixin

Convenience builders for GenomeSpy lazy data sources.

Description:

These helpers build schema-backed genome_spy.schema.Data objects with a populated lazy block so callers can stay within the handwritten chart API instead of assembling nested dictionaries by hand.

Example

>>> lazy.bigwig("https://example.test/signal.bw")
>>> lazy.gff3("https://example.test/genes.gff3.gz", windowSize=2_000_000)

Methods

bam(url, /, *[, channel, debounce, ...])

Create a lazy bam data source.

bigbed(url, /, *[, channel, debounce, ...])

Create a lazy bigbed data source.

bigwig(url, /, *[, channel, debounce, ...])

Create a lazy bigwig data source.

gff3(url, /, *[, addChrPrefix, channel, ...])

Create a lazy gff3 data source.

indexed_fasta(url, /, *[, channel, ...])

Create a lazy indexedFasta data source.

source(type, url, /, **kwargs)

Create a lazy data source of an arbitrary GenomeSpy type.

tabix(url, /, *[, addChrPrefix, channel, ...])

Create a lazy tabix data source.

vcf(url, /, *[, addChrPrefix, channel, ...])

Create a lazy vcf data source.

source(type, url, /, **kwargs)View on GitHub

Create a lazy data source of an arbitrary GenomeSpy type.

Description:

This is the generic escape hatch for lazy data sources. Named helpers such as bigwig() and gff3() cover each schema-defined URL-backed source type.

Parameters:
  • type – GenomeSpy lazy source type such as "bigwig" or "gff3".

  • url – Remote data URL.

  • **kwargs – Additional lazy-source parameters supported by GenomeSpy.

Returns:

A schema-backed genome_spy.schema.Data object.

Raises:

No exceptions are raised directly here.

Example

>>> lazy.source("bigwig", "https://example.test/signal.bw")
bam(url, /, *, channel=Undefined, debounce=Undefined, debounceDomainChange=Undefined, debounceMode=Undefined, indexUrl=Undefined, windowSize=Undefined)View on GitHub

Create a lazy bam data source.

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

  • 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"

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

  • windowSize (float | ExprRef | dict[str, Any]) – Size of each chunk when fetching the BAM file. Data is only fetched when the length of the visible domain smaller than the window size. __Default value:__ 10000

bigbed(url, /, *, channel=Undefined, debounce=Undefined, debounceDomainChange=Undefined, debounceMode=Undefined, windowSize=Undefined)View on GitHub

Create a lazy bigbed data source.

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

  • 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"

  • windowSize (float | ExprRef | dict[str, Any]) – Size of each chunk when fetching the BigBed file. Data is only fetched when the length of the visible domain smaller than the window size. __Default value:__ 1000000

bigwig(url, /, *, channel=Undefined, debounce=Undefined, debounceDomainChange=Undefined, debounceMode=Undefined, pixelsPerBin=Undefined)View on GitHub

Create a lazy bigwig data source.

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

  • 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"

  • pixelsPerBin (float | ExprRef | dict[str, Any]) – The approximate minimum width of each data bin, in pixels. __Default value:__ 2

gff3(url, /, *, addChrPrefix=Undefined, channel=Undefined, debounce=Undefined, debounceDomainChange=Undefined, debounceMode=Undefined, indexUrl=Undefined, windowSize=Undefined)View on GitHub

Create a lazy gff3 data source.

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

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

  • 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"

  • 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".

  • 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

indexed_fasta(url, /, *, channel=Undefined, debounce=Undefined, debounceDomainChange=Undefined, debounceMode=Undefined, indexUrl=Undefined, windowSize=Undefined)View on GitHub

Create a lazy indexedFasta data source.

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

  • 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"

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

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

tabix(url, /, *, addChrPrefix=Undefined, channel=Undefined, columns=Undefined, debounce=Undefined, debounceDomainChange=Undefined, debounceMode=Undefined, indexUrl=Undefined, parse=Undefined, windowSize=Undefined)View on GitHub

Create a lazy tabix data source.

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

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

  • 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.

  • 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"

  • 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".

  • 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"

  • 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

vcf(url, /, *, addChrPrefix=Undefined, channel=Undefined, debounce=Undefined, debounceDomainChange=Undefined, debounceMode=Undefined, indexUrl=Undefined, windowSize=Undefined)View on GitHub

Create a lazy vcf data source.

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

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

  • 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"

  • 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".

  • 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