RunPcaResults

RunPcaResults

Wrapper for the PCA results on the Wasm heap, typically created by runPca.

Classes

RunPcaResults

Methods

free()

Source:
Returns:

Frees the memory allocated on the Wasm heap for this object. This invalidates this object and all references to it.

numberOfCells() → {number}

Source:
Returns:

Number of cells used to compute these results.

Type
number

numberOfPCs() → {number}

Source:
Returns:

Number of PCs available in these results.

Type
number

principalComponents(optionsopt) → (nullable) {Float64Array|Float64Wasmarray}

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

Optional parameters.

Properties
Name Type Attributes Default Description
copy boolean <optional>
true

Whether to copy the results from the Wasm heap, see possibleCopy.

fillable boolean <optional>
false

Whether to return a fillable array, to write to this object. If true, this method automatically sets copy = false if copy was previously true. If false and the array was not previously filled, null is returned.

Returns:

Array containing the principal components for all cells. This should be treated as a column-major array where the rows are the PCs and columns are the cells. Alternatively null, if fillable = false and the array was not already filled.

Type
Float64Array | Float64Wasmarray

setTotalVariance(total)

Source:
Parameters:
Name Type Description
total number

Total variance in the dataset, equal to the sum of the variances across all PCs (including those that were not explicitly computed).

Returns:

Total varaiance in this object is set to total. This is primarily intended for use with emptyRunPcaResults.

totalVariance() → (nullable) {number}

Source:
Returns:

The total variance in the dataset, typically used with varianceExplained to compute the proportion of variance explained. Alternatively null, if this value has not been filled by setTotalVariance.

Type
number

varianceExplained(optionsopt) → (nullable) {Float64Array|Float64WasmArray}

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

Optional parameters.

Properties
Name Type Attributes Default Description
copy boolean <optional>
true

Whether to copy the results from the Wasm heap, see possibleCopy.

fillable boolean <optional>
false

Whether to return a fillable array, to write to this object. If true, this method automatically sets copy = false if copy was previously true. If false and the array was not previously filled, null is returned.

Returns:

Array containing the variance explained for each requested PC. Alternatively null, if fillable = false and the array was not already filled.

Type
Float64Array | Float64WasmArray