ClusterSnnGraphWalktrapResults

ClusterSnnGraphWalktrapResults

Wrapper around the SNN walktrap clustering results on the Wasm heap, produced by clusterSnnGraph.

Classes

ClusterSnnGraphWalktrapResults

Methods

free()

Source:
Returns:

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

membership(optionsopt) → (nullable) {Int32Array|Int32WasmArray}

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

Optional parameters.

Properties
Name Type Attributes Default Description
copy boolean | string <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 cluster membership for each cell. Alternatively null, if fillable = false and the array was not already filled.

Type
Int32Array | Int32WasmArray

modularity(optionsopt) → (nullable) {number}

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

Optional parameters.

Properties
Name Type Attributes Default Description
at number <optional>
<nullable>
null

Index at which to extract the modularity. This can be any value from 0 to numberOfMergeSteps plus 1. Set to null to obtain the largest modularity across all merge steps.

Returns:

The modularity at the specified merge step, or the maximum modularity across all merge steps. Alternatively null, if this has not been set by setModularity.

Type
number

numberOfMergeSteps() → {number}

Source:
Returns:

Number of merge steps used by the Walktrap algorithm.

Type
number

setModularity(at, modularity)

Source:
Parameters:
Name Type Description
at number

Index at which to set the modularity. This can be any value from 0 to numberOfMergeSteps plus 1.

modularity number

Modularity value.

Returns:

Modularity value is set in this object. This is typically used after calling emptyClusterSnnGraphResults.