H5adDataset

H5adDataset

Dataset in the H5AD format.

Constructor

new H5adDataset(h5File)

Source:
Parameters:
Name Type Description
h5File SimpleFile | string | Uint8Array | File

Contents of a H5AD file. On browsers, this may be a File object. On Node.js, this may also be a string containing a file path.

Classes

H5adDataset

Methods

abbreviate() → {object}

Source:
Returns:

Object containing the abbreviated details of this dataset.

Type
object

clear()

Description:
  • Destroy caches if present, releasing the associated memory. This may be called at any time but only has an effect if cache = true in load or {@linkcodeH5adDataset#summary summary}.

Source:

load(optionsopt) → {object}

Source:
Parameters:
Name Type Attributes Default Description
options object <optional>
{}

Optional parameters.

Properties
Name Type Attributes Default Description
cache boolean <optional>
false

Whether to cache the intermediate results for re-use in subsequent calls to any methods with a cache option. If true, users should consider calling clear to release the memory once this dataset instance is no longer needed.

Returns:

Object containing the per-feature and per-cell annotations. This has the following properties:

  • features: an object where each key is a modality name and each value is a DataFrame of per-feature annotations for that modality.
  • cells: a DataFrame containing per-cell annotations.
  • matrix: a MultiMatrix containing one ScranMatrix per modality.
  • primary_ids: an object where each key is a modality name and each value is an array (usually of strings) containing the primary feature identifiers for each row in that modality.

Modality names are guaranteed to be one of "RNA", "ADT" or "CRISPR". We assume that the instance already contains an appropriate mapping from the observed feature types to each expected modality, either from the defaults or with setOptions.

Type
object

options() → {object}

Source:
Returns:

Object containing all options used for loading.

Type
object

previewPrimaryIds(optionsopt) → {object}

Source:
Parameters:
Name Type Attributes Default Description
options object <optional>
{}

Optional parameters.

Properties
Name Type Attributes Default Description
cache boolean <optional>
false

Whether to cache the intermediate results for re-use in subsequent calls to any methods with a cache option. If true, users should consider calling clear to release the memory once this dataset instance is no longer needed.

Returns:

An object where each key is a modality name and each value is an array (usually of strings) containing the primary feature identifiers for each row in that modality. The contents are the same as the primary_ids returned by load but the order of values may be different.

Type
object

serialize() → {object}

Source:
Returns:

Object describing this dataset, containing:

  • files: Array of objects representing the files used in this dataset. Each object corresponds to a single file and contains:
    • type: a string denoting the type.
    • file: a SimpleFile object representing the file contents.
  • options: An object containing additional options to saved.
Type
object

setOptions(options)

Source:
Parameters:
Name Type Description
options object

Optional parameters that affect load (but not summary).

Properties
Name Type Attributes Description
countMatrixName string <optional>
<nullable>

Name of the layer containing the count matrix. If null, the "X" dataset is used if it is present in the file, or the first available layer if no "X" dataset is present.

featureTypeColumnName string <optional>
<nullable>

Name of the per-feature annotation column containing the feature types. If null, no column is assumed to contain feature type information.

featureTypeRnaName string <optional>
<nullable>

Name of the feature type for gene expression. If null or the string is not present among the feature types, no RNA features are to be loaded.

If no feature type information is available in the dataset (i.e., featureTypeColumnName = null), all features are considered to be genes by default. This behavior can also be explicitly requested by setting this argument to the only non-null value among all featureType*Name parameters.

featureTypeAdtName string <optional>
<nullable>

Name of the feature type for ADTs. If null or the string is not present among the feature types, no ADT features are to be loaded.

If no feature type information is available in the dataset and this argument is set to the only non-null value among all featureType*Name parameters, all features are considered to be ADTs.

featureTypeCrisprName string <optional>
<nullable>

Name of the feature type for CRISPR guides. If null or the string is not present among the feature types, no guides are to be loaded.

If no feature type information is available in the dataset and this argument is set to the only non-null value among all featureType*Name parameters, all features are considered to be guides.

primaryRnaFeatureIdColumn string | number <optional>
<nullable>

Name or index of the column of the features DataFrame that contains the primary feature identifier for gene expression.

If i is null or invalid (e.g., out of range index, unavailable name), it is ignored and the row names (from the _index group) are used as the primary identifiers. If no row names are present in this situation, no primary identifier is defined.

primaryAdtFeatureIdColumn string | number <optional>
<nullable>

Name or index of the column of the features DataFrame that contains the primary feature identifier for the ADTs.

If i is null or invalid (e.g., out of range index, unavailable name), it is ignored and the row names (from the _index group) are used as the primary identifiers. If no row names are present in this situation, no primary identifier is defined.

primaryCrisprFeatureIdColumn string | number <optional>
<nullable>

Name or index of the column of the features DataFrame that contains the primary feature identifier for the CRISPR guides.

If i is null or invalid (e.g., out of range index, unavailable name), it is ignored and the row names (from the _index group) are used as the primary identifiers. If no row names are present in this situation, no primary identifier is defined.

summary(optionsopt) → {object}

Source:
Parameters:
Name Type Attributes Default Description
options object <optional>
{}

Optional parameters.

Properties
Name Type Attributes Default Description
cache boolean <optional>
false

Whether to cache the intermediate results for re-use in subsequent calls to any methods with a cache option. If true, users should consider calling clear to release the memory once this dataset instance is no longer needed.

Returns:

Object containing the per-feature and per-cell annotations. This has the following properties:

  • all_features: a DataFrame of per-feature annotations.
  • cells: a DataFrame of per-cell annotations.
  • all_assay_names: an Array of strings containing names of potential count matrices.
Type
object

(static) defaults() → {object}

Source:
Returns:

Default options, see setOptions for more details.

Type
object

(static) format() → {string}

Source:
Returns:

Format of this dataset class.

Type
string

(async, static) unserialize(files, options) → {H5adDataset}

Source:
Parameters:
Name Type Description
files Array

Array of objects like that produced by serialize.

options object

Object containing additional options to be passed to the constructor.

Returns:

A new instance of this class.

Type
H5adDataset