genome_spy.data_format

genome_spy.data_format(*, columns=Undefined, delimiter=Undefined, parse=Undefined, property=Undefined, type=Undefined)View on GitHub

Create a data-format wrapper.

Parameters:
  • columns (Sequence[str]) – Optional ordered list of field names for headerless BEDPE input. If omitted, BEDPE fields are resolved from the default BEDPE column order or from a matching header row when present.

  • 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) – If set to null, disable type inference based on the spec and only use type inference based on the data. Alternatively, a parsing directive object can be provided for explicit data types. Each property of the object corresponds to a field name, and the value to the desired data type (one of "number", "boolean", "date", or null (do not parse the field)). For example, "parse": {"modified_on": "date"} parses the modified_on field in each input record a Date value. For "date", we parse data based using Javascript’s Date.parse(). Specific date formats can be provided (e.g., {foo: "date:'%m%d%Y'"}), using the d3-time-format syntax. UTC date format parsing is supported similarly (e.g., {foo: "utc:'%m%d%Y'"}). See more about UTC parsing in the Vega-Lite UTC time documentation.

  • 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 (str) – Type of input data: "json", "csv", "tsv", "dsv". __Default value:__ The default format type is determined by the extension of the file URL. Compression suffixes such as .gz are ignored during inference. If no extension is detected, "json" will be used by default.