genome_spy.CrossData

class genome_spy.CrossData(description=Undefined, format=Undefined, name=Undefined, sequence=Undefined, url=Undefined, values=Undefined, **kwds)View on GitHub

Bases: GenomeSpySchema

Generated wrapper for CrossData.

Methods

copy(*[, deep])

Return a copy with optional keyword updates.

description(value)

Return a copy with description updated.

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

Return a copy with format updated.

name(value)

Return a copy with name updated.

resolve_references()

Return this class schema with referenced properties merged in.

sequence([value, as_, start, step, stop])

Return a copy with a SequenceParams sequence.

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.

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.

name(value)View on GitHub

Return a copy with name updated.

sequence(value=Undefined, /, *, as_=Undefined, start=Undefined, step=Undefined, stop=Undefined)View on GitHub

Return a copy with a SequenceParams sequence.

Parameters:
  • as_ (FieldName_T | ExprRef | dict[str, Any]) – The name of the generated sequence field. __Default value:__ "data"

  • start (float | ExprRef | dict[str, Any]) – The starting value of the sequence (inclusive).

  • step (float | ExprRef | dict[str, Any]) – The step value between sequence entries. __Default value:__ 1

  • stop (float | ExprRef | dict[str, Any]) – The ending value of the sequence (exclusive).

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.