BatchCorrectionState

BatchCorrectionState

Correct for batch effects in PC space based on mutual nearest neighbors. This wraps the mnnCorrect function from scran.js.

Methods not documented here are not part of the stable API and should not be used by applications.

Classes

BatchCorrectionState

Methods

compute(parameters)

Description:
  • This method should not be called directly by users, but is instead invoked by runAnalysis.

Source:
Parameters:
Name Type Description
parameters object

Parameter object, equivalent to the batch_correction property of the parameters of runAnalysis.

Properties
Name Type Description
method string

The correction method to use. Currently this can be either "mnn" or "none". If "mnn", it is recommended that upstream PCA steps (i.e., RnaPcaState and AdtPcaState) use block_method = "project".

num_neighbors number

Number of neighbors to use during MNN correction.

approximate boolean

Whether to use an approximate method to identify MNNs.

Returns:

The object is updated with new results.

fetchCorrected() → {Float64WasmArray}

Source:
Returns:

Buffer containing the batch-corrected embeddings as a column-major dense matrix, where the rows are the dimensions and the columns are the cells. This is available after running compute.

Type
Float64WasmArray

fetchNumberOfCells() → {number}

Source:
Returns:

Number of cells in fetchCorrected.

Type
number

fetchNumberOfDimensions() → {number}

Source:
Returns:

Number of dimensions in fetchCorrected.

Type
number

fetchParameters() → {object}

Source:
Returns:

Object containing the parameters.

Type
object