AbstractResult

AbstractResult

Pre-computed analysis results stored as a SummarizedExperiment object (or one of its subclasses) in the * takane format. This is intended as a virtual base class; applications should define their own subclasses with appropriate getter and listing methods.

Constructor

new AbstractResult(path, getter, lister)

Source:
Parameters:
Name Type Description
path string

Some kind of the path to the SummarizedExperiment. The exact interpretation of this argument is left to subclasses.

getter function

A (possibly async) function that accepts a string containing the relative path to the file of interest, and returns a Uint8Array of that file's contents. Each path is created by adding unix-style file separators to path.

lister function

A (possibly async) function that accepts a string containing the relative path to the directory of interest, and returns an array of the contents of that directory (non-recursive). Each path is created by adding unix-style file separators to path.

Classes

AbstractResult

Methods

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

Source:

(async) 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 results for re-use in subsequent calls to this method or summary. 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.
  • reduced_dimensions: an object containing the dimensionality reduction results. Each value is an array of arrays, where each inner array contains the coordinates for one dimension.
  • other_metadata: an object containing other metadata.
Type
object

options() → {object}

Source:
Returns:

Object containing all options used for loading.

Type
object

setOptions(options)

Source:
Parameters:
Name Type Description
options object

Optional parameters that affect load (but not summary.

Properties
Name Type Attributes Description
primaryAssay object | string | number <optional>

Assay containing the relevant data for each modality.

  • If a string, this is used as the name of the assay across all modalities.
  • If a number, this is used as the index of the assay across all modalities.
  • If any object, the key should be the name of a modality and the value may be either a string or number specifying the assay to use for that modality. Modalities absent from this object will not be loaded.
isPrimaryNormalized object | boolean <optional>

Whether or not the assay for a particular modality has already been log-normalized.

  • If a boolean, this is used to indicate normalization status of assays across all modalities. If false, that modality's assay is assumed to contain count data and is subjected to scaling normalization and log-transformation.
  • If any object, the key should be the name of a modality and the value should be a boolean indicating whether that modality's assay has been log-normalized. Modalities absent from this object are assumed to have been normalized.
sizeFactors object | string | boolean <optional>

What size factors to use for scaling normalization.

  • If false, the library size (i.e., total sum of counts) is used to normalize each assay. No size factors are used from the column data of any experiment.
  • If true, each experiment's column data is searched for the sizefactor, size_factor, sizefactors or size_factors columns (ignoring any case). If found and the column contains only numeric values, it is used to supply the size factors. Otherwise, the library sizes are used.
  • If a string, the column of the same name is assumed to store the size factors for each experiment. If no column exists with this name, the library sizes are used.
  • If an object, the key should be the name of a modality and the value should be a boolean or string specifying the size factors to use for that modality based on the points mentioned above. For any modality absent from this object, the value is assumed to be true.

Note that this option only has an effect on the assays that need log-normalization, according to isPrimaryNormalized.

reducedDimensionNames Array <optional>
<nullable>

Array of names of the reduced dimensions to load. If null, all reduced dimensions found in the file are loaded.

(async) 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 results for re-use in subsequent calls to this method or load. 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:

  • modality_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 of per-cell annotations.
  • modality_assay_names: an object where each key is a modality name and each value is an Array containing the names of available assays for that modality. Unnamed assays are represented as null names.
  • reduced_dimension_names: an Array of strings containing names of dimensionality reduction results.
  • other_metadata: an object containing other metadata.
Type
object

(static) defaults() → {object}

Source:
Returns:

Default options, see setOptions for more details.

Type
object