ClusterSnnGraphMultiLevelResults

ClusterSnnGraphMultiLevelResults

Wrapper around the SNN multi-level clustering results on the Wasm heap, produced by clusterSnnGraph.

Classes

ClusterSnnGraphMultiLevelResults

Methods

best() → (nullable) {number}

Source:
Returns:

The clustering level with the highest modularity. Alternatively null, if this has not been previously set via setBest.

Type
number

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
level number <optional>
<nullable>
null

The clustering level for which to obtain the cluster membership. Defaults to the best clustering level from best.

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 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
level number <optional>
<nullable>
null

The clustering level for which to obtain the modularity. Defaults to the best clustering level from best.

Returns:

The modularity at the specified level. Alternatively null, if this has not been set by setModularity.

Type
number

numberOfLevels() → {number}

Source:
Returns:

Number of levels in the results.

Type
number

setBest(best)

Source:
Parameters:
Name Type Description
best number

Clustering level with the highest modularity.

Returns:

best is set as the best clustering level. This is typically only used after emptyClusterSnnGraphResults.

setModularity(level, modularity)

Source:
Parameters:
Name Type Description
level number

The clustering level at which to set the modularity.

modularity number

Modularity value.

Returns:

modularity is set as the modularity at the specified level. This is typically only used after emptyClusterSnnGraphResults.