MarkerDetectionStandalone

MarkerDetectionStandalone

Standalone version of MarkerDetectionState that provides the same functionality outside of runAnalysis. Users can supply their own normalized matrices, groups and blocking factor to compute the various marker statistics for each group. Users are also responsible for ensuring that the lifetime of the supplied objects exceeds that of the constructed MarkerDetectionStandalone instance, i.e., the Wasm-related free() methods are not called while the MarkerDetectionStandalone instance is still in operation.

Constructor

new MarkerDetectionStandalone(normalized, groups, optionsopt)

Source:
Parameters:
Name Type Attributes Default Description
normalized external:MultiMatrix

A MultiMatrix of log-normalized values for multiple modalities.

groups Array | TypedArray

Array of length equal to the number of columns in any value of normalized, containing the group assignments for each column.

options object <optional>
{}

Optional parameters.

Properties
Name Type Attributes Default Description
block Array | TypedArray <optional>
<nullable>
null

Array of length equal to the number of columns in any value of normalized, containing the block assignments for each column. If null, all columns are assigned to the same block.

Classes

MarkerDetectionStandalone

Methods

computeAll()

Description:
  • Compute markers for all groups.

Source:
Returns:

The state is updated with new results.

computeVersus(left, right) → {object}

Description:
  • Extract markers for a pairwise comparison between two groups, for more detailed examination of the differences between them.

Source:
Parameters:
Name Type Description
left number

Index of one group in which to find upregulated markers.

right number

Index of another group to be compared against left.

Returns:

Object containing:

  • results: object containing the marker statistics for the comparison between two groups. Each key is a modality name and each value is a ScoreMarkersResults object.
  • left: index of the group corresponding to the left group in each ScoreMarkersResults object, e.g., Cohen's d for the RNA markers of the left group are defined as output.results.RNA.cohen(output.left).
  • right: index of the group corresponding to the right group in each ScoreMarkersResults object. e.g., Cohen's d for the RNA markers of the left group are defined as output.results.RNA.cohen(output.right).
Type
object

fetchBlockLevels(optionsopt) → {Array}

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 return value on output. Set to false for greater efficiency in strictly read-only applications.

Returns:

Array of levels for the blocking factor. Block indices in the ScoreMarkersResults instances returned by fetchResults can be cross-referenced to this array.

Type
Array

fetchGroupLevels(optionsopt) → {Array}

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 return value on output. Set to false for greater efficiency in strictly read-only applications.

Returns:

Array of levels for the grouping factor. Group indices in the ScoreMarkersResults instances returned by fetchResults can be cross-referenced to this array.

Type
Array

fetchParameters() → {object}

Source:
Returns:

Object containing the parameters.

Type
object

fetchResults() → {object}

Source:
Returns:

Marker detection results for the all modalities. Each key is a modality name and each value is an ScoreMarkerResults object, containing marker detection statistics for all groups. This is available after running compute.

Type
object

free()

Description:
  • Frees all resources associated with this instance.

Source:

setParameters(parameters)

Description:
  • If this method is not called, the parameters default to those in MarkerDetectionState.defaults.

Source:
Parameters:
Name Type Description
parameters object

Parameter object, see the argument of the same name in MarkerDetectionState.compute for more details.

Returns:

The state is updated with new parameters.