genome_spy.data.LazyNamespace¶
- class genome_spy.data.LazyNamespaceView on GitHub¶
Bases:
LazyDataMethodMixinConvenience builders for GenomeSpy lazy data sources.
- Description:
These helpers build schema-backed
genome_spy.schema.Dataobjects with a populatedlazyblock 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
bamdata source.bigbed(url, /, *[, channel, debounce, ...])Create a lazy
bigbeddata source.bigwig(url, /, *[, channel, debounce, ...])Create a lazy
bigwigdata source.figwig(url, /, *[, channel, debounce, ...])Create a lazy
figwigdata source.gff3(url, /, *[, addChrPrefix, channel, ...])Create a lazy
gff3data source.indexed_fasta(url, /, *[, channel, ...])Create a lazy
indexedFastadata source.source(type, url, /, **kwargs)Create a lazy data source of an arbitrary GenomeSpy type.
tabix(url, /, *[, addChrPrefix, channel, ...])Create a lazy
tabixdata source.vcf(url, /, *[, addChrPrefix, channel, ...])Create a lazy
vcfdata 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()andgff3()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.Dataobject.- 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, tags=Undefined, windowSize=Undefined)View on GitHub¶
Create a lazy
bamdata 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:__
200debounceDomainChange (float | ExprRef | dict[str, Any]) – Debounce time for scale-domain driven data updates, in milliseconds. __Default value:__
200debounceMode (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
urlis a template, this can be an index URL template using the same placeholder and values. __Default value:__url+".bai".tags (Sequence[str]) – SAM auxiliary tags to expose on each read, for example
["HP", "CB"]. Each tag is available as a field namedtag_followed by the tag name, for exampletag_HP. The field isundefinedwhen a read lacks the tag. Tags that are not listed are not decoded.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
bigbeddata 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:__
200debounceDomainChange (float | ExprRef | dict[str, Any]) – Debounce time for scale-domain driven data updates, in milliseconds. __Default value:__
200debounceMode (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
bigwigdata 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:__
200debounceDomainChange (float | ExprRef | dict[str, Any]) – Debounce time for scale-domain driven data updates, in milliseconds. __Default value:__
200debounceMode (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
- figwig(url, /, *, channel=Undefined, debounce=Undefined, debounceDomainChange=Undefined, debounceMode=Undefined, maxSummaryPixels=Undefined, mode=Undefined, pixelsPerBin=Undefined, tracks=Undefined)View on GitHub¶
Create a lazy
figwigdata 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:__
200debounceDomainChange (float | ExprRef | dict[str, Any]) – Debounce time for scale-domain driven data updates, in milliseconds. __Default value:__
200debounceMode (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"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
pixelsPerBintarget. Coarser requested bins still followpixelsPerBin. Does not change exact mode or raw-data binning. __Default value:__4mode (Literal['exact'] | Literal['fast'] | ExprRef | dict[str, Any]) – Signal query mode.
"fast"favors interactive browsing by using rounded summaries when their resolution meetspixelsPerBinor the finest summary fits withinmaxSummaryPixels. 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"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:__
2tracks (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.
- gff3(url, /, *, addChrPrefix=Undefined, channel=Undefined, debounce=Undefined, debounceDomainChange=Undefined, debounceMode=Undefined, indexUrl=Undefined, windowSize=Undefined)View on GitHub¶
Create a lazy
gff3data source.- Parameters:
addChrPrefix (bool | str) – Add a
chr(boolean) or custom (string) prefix to the chromosome names in the Tabix file. __Default value:__falsechannel (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:__
200debounceDomainChange (float | ExprRef | dict[str, Any]) – Debounce time for scale-domain driven data updates, in milliseconds. __Default value:__
200debounceMode (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
urlis 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
indexedFastadata 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:__
200debounceDomainChange (float | ExprRef | dict[str, Any]) – Debounce time for scale-domain driven data updates, in milliseconds. __Default value:__
200debounceMode (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
urlis 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
tabixdata source.- Parameters:
addChrPrefix (bool | str) – Add a
chr(boolean) or custom (string) prefix to the chromosome names in the Tabix file. __Default value:__falsechannel (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:__
200debounceDomainChange (float | ExprRef | dict[str, Any]) – Debounce time for scale-domain driven data updates, in milliseconds. __Default value:__
200debounceMode (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
urlis 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
nullto 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
vcfdata source.- Parameters:
addChrPrefix (bool | str) – Add a
chr(boolean) or custom (string) prefix to the chromosome names in the Tabix file. __Default value:__falsechannel (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:__
200debounceDomainChange (float | ExprRef | dict[str, Any]) – Debounce time for scale-domain driven data updates, in milliseconds. __Default value:__
200debounceMode (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
urlis 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