CellFilteringState

CellFilteringState

This step filters the count matrices to remove low-quality cells, based on metrics and thresholds computed in RnaQualityControlState and friends. It wraps the filterCells function from scran.js. For multi-modal datasets, this can combine quality calls from all valid modalities; a cell is removed if it is considered low-quality in any individual modality.

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

Classes

CellFilteringState

Methods

applyFilter(Any) → {Array|TypedArray}

Description:
  • Apply the same filter to an array of data for each cell in the unfiltered dataset. This is typically used to filter the columns of InputsState.fetchCellAnnotations for downstream use. (See the undoFilter method for the reverse operation.) Any calls to this method should be done after running compute.

Source:
Parameters:
Name Type Description
Any Array | TypedArray

array-like object of length equal to the number of cells in the unfiltered dataset.

Returns:

An array-like object of the same type as x, where all elements corresponding to low-quality cells have been discarded. This will have number of columns equal to that of fetchFilteredMatrix.

Type
Array | TypedArray

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 cell_filtering property of the parameters of runAnalysis.

Properties
Name Type Description
use_rna boolean

Whether to use the RNA-derived QC metrics for filtering.

use_adt boolean

Whether to use the ADT-derived QC metrics for filtering.

use_crispr boolean

Whether to use the CRISPR-derived QC metrics for filtering.

Returns:

The object is updated with the new results.

fetchDiscards() → (nullable) {Uint8WasmArray}

Source:
Returns:

Combined discard vector, i.e., an array of length equal to the number of cells in the dataset, indicating whether each cell should be removed. This is available after running compute. Alternatively null, if no upstream filtering steps were performed.

Type
Uint8WasmArray

fetchFilteredBlock() → {Int32WasmArray}

Source:
Returns:

Array of length equal to the number of cells after filtering, containing the block assignment for each cell. This is available after running compute. Alternatively null if no blocks are present in the dataset.

Type
Int32WasmArray

fetchFilteredMatrix() → {external:MultiMatrix}

Source:
Returns:

A MultiMatrix object containing the filtered and normalized matrices for all modalities, available after running compute.

Type
external:MultiMatrix

fetchParameters() → {object}

Source:
Returns:

Object containing the parameters.

Type
object

undoFilter(indices)

Description:
  • Undo the effect of filtering on an array of column indices on the filtered matrix, so that they now refer to column indices on the unfiltered matrix. This is primarily useful for adjusting indices from downstream steps like CustomSelectionsState.fetchSelectionIndices. The output of this function can be combined with InputsState.undoSubset to obtain column indices on the original matrix, which can be used in other contexts, e.g., like subsetInputs.

Source:
Parameters:
Name Type Description
indices Array | TypedArray

Array of column indices to the filtered matrix. Note that this will be modified in-place.

Returns:

Entries of indices are replaced with indices to the unfiltered matrix.