RnaQualityControlState

RnaQualityControlState

This step applies quality control on the RNA count matrix. Specifically, it computes the QC metrics and filtering thresholds, wrapping the perCellRnaQcMetrics and suggestRnaQcFilters functions from scran.js. Note that the actual filtering is done by CellFilteringState.

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

Classes

RnaQualityControlState

Members

mitochondriaSpecies :Array

Description:
  • Array of strings containing the taxonomy IDs for species where mitochondrial gene lists are available.

Source:

Array of strings containing the taxonomy IDs for species where mitochondrial gene lists are available.

Type:
  • Array

Methods

(async) 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 rna_quality_control property of the parameters of runAnalysis.

Properties
Name Type Attributes Description
guess_ids boolean

Automatically choose feature-based parameters based on the feature annotation for the RNA modality. If set to true, the following logic is applied:

  • If use_reference_mito = true, the annotation column that best matches human/mouse Ensembl/symbols is set as gene_id_column. Based on the identified species and feature type, species and gene_id_type are also set.
  • If use_reference_mito = false, the annotation column that best matches human/mouse symbols is set as gene_id_column.
gene_id_column string | number <nullable>

Name or index of the column of the feature annotations that contains the gene identifiers for the RNA modality. If null, the row names are used. Ignored if guess_ids = true.

use_reference_mito boolean

Whether to use the reference lists of mitochondrial genes. If false, mitochondrial genes are instead identified from their prefix.

species Array

Array of strings specifying zero, one or more species to use to obtain a reference list of mitochondrial genes. Each entry should be a taxonomy ID (e.g. "9606", "10090") as specified in mitochondriaSpecies). Ignored if guess_ids = true.

gene_id_type string

Name of the feature type in the reference list of mitochondrial genes. This can be any one of "ENSEMBL", "SYMBOL", or "ENTREZ". Ignored if guess_ids = true.

mito_prefix string <nullable>

Case-insensitive prefix to use to identify mitochondrial genes from the dataset. Only used when use_reference_mito = false; in such cases, gene_id_column should point to symbols. If null, no prefix-based identification is performed.

filter_strategy string

Strategy for defining a filter threshold for the QC metrics. This can be "automatic" or "manual".

nmads number

Number of MADs to use for automatically selecting the filter threshold for each metric. Only used when filter_strategy = "automatic".

sum_threshold number

Manual threshold on the sum of counts for each cell. Cells are only retained if their sums are equal to or greater than this threshold. Only used when filter_strategy = "manual".

detected_threshold number

Manual threshold on the detected number of features for each cell. Cells are only retained if the detected number is equal to or greater than this threshold. Only used when filter_strategy = "manual".

mito_threshold number

Manual threshold on the mitochondrial proportion for each cell. Cells are only retained if their totals are less than or equal to this threshold. Only used when filter_strategy = "manual".

Returns:

The object is updated with the new results.

fetchDiscards() → {Uint8WasmArray}

Source:
Returns:

Buffer containing the discard vector of length equal to the number of cells, where each element is truthy if the corresponding cell is to be discarded.

Type
Uint8WasmArray

fetchFilters() → {external:SuggestRnaQcFiltersResults}

Source:
Returns:

Result of filtering on the RNA-derived QC metrics.

Type
external:SuggestRnaQcFiltersResults

fetchMetrics() → {external:PerCellRnaQcMetricsResults}

Source:
Returns:

RNA-derived QC metrics.

Type
external:PerCellRnaQcMetricsResults

fetchParameters() → {object}

Source:
Returns:

Object containing the parameters.

Type
object

(static) flush()

Description:
  • Flush all cached lists of mitochondrial genes.

    By default, compute will cache the mitochondrial gene lists in a static member for re-use across RnaQualityControlState instances. These cached lists are not tied to any single instance and will not be removed by garbage collectors or by freeAnalysis. Rather, this function should be called to release the relevant memory.

Source:

(static) setDownload(fun)

Description:
  • Specify a function to download the reference mitochondrial gene lists.

Source:
Parameters:
Name Type Description
fun function

Function that accepts a single string containing a URL and returns any value that can be used in the SimpleFile constructor. This is most typically a Uint8Array of that URL's contents, but it can also be a path to a locally cached file on Node.js.

Returns:

fun is set as the global downloader for this step. The previous value of the downloader is returned.