MultiMatrix

MultiMatrix

Helper class for handling matrix data from multiple modalities. In particular, it simplifies memory management of the assorted ScranMatrix instances containing data for different features in the same set of cells.

Constructor

new MultiMatrix(optionsopt)

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

Optional parameters.

Properties
Name Type Attributes Default Description
store object <optional>
{}

Existing store of ScranMatrix objects. Each matrix should correspond to a different modality, named according to its key. All matrices should have data for the same set of cells, i.e., same number of columns.

Classes

MultiMatrix

Methods

add(i, matrix)

Source:
Parameters:
Name Type Description
i string

Name of a modality.

matrix ScranMatrix

The matrix data for modality i.

Returns:

matrix is added to the MultiMatrix with name i.

available() → {Array}

Source:
Returns:

Names of the available modalities.

Type
Array

clone(i) → {MultiMatrix}

Source:
Parameters:
Name Type Description
i string

Name of a modality.

Returns:

A deep copy of the current object.

Type
MultiMatrix

free()

Source:
Returns:

Frees memory for all modalities in this MultiMatrix.

get(i) → {ScranMatrix}

Source:
Parameters:
Name Type Description
i string

Name of a modality.

Returns:

The matrix data for modality i.

Type
ScranMatrix

has(i) → {boolean}

Source:
Parameters:
Name Type Description
i string

Name of a modality.

Returns:

Whether modality i is available.

Type
boolean

numberOfColumns() → (nullable) {number}

Source:
Returns:

Number of columns in the matrices. If no matrices are available, null is returned.

Type
number

remove(i)

Source:
Parameters:
Name Type Description
i string

Name of a modality.

Returns:

Modality i is removed from the MultiMatrix.

rename(from, to)

Source:
Parameters:
Name Type Description
from string

Old name of the modality.

to string

New name for the modality.

Returns:

The modality from is renamed to to, possibly replacing any existing modality at to.