FeatureSetEnrichmentStandalone

FeatureSetEnrichmentStandalone

Standalone version of FeatureSetEnrichmentState that provides the same functionality outside of runAnalysis. Users can supply their own annotations to prepare the collections for enrichment calculations. Users should await on the return value of the ready method after construction. Once resolved, other methods in this class may be used.

This class uses the gesel package to download the default gene set databases for the relevant organisms. Its behavior can be tuned by setting global gesel variables, e.g., using the referenceDownload function.

Constructor

new FeatureSetEnrichmentStandalone(annotations, optionsopt)

Source:
Parameters:
Name Type Attributes Default Description
annotations external:DataFrame

A DataFrame of per-gene annotations, where each row corresponds to a gene.

options object <optional>
{}

Optional parameters.

Properties
Name Type Attributes Default Description
normalized external:ScranMatrix <optional>
<nullable>
null

A ScranMatrix of log-normalized expression values, to be used in FeatureSetEnrichmentStandalone.computePerCellScores. Each row corresponds to a gene in the same order as annotations.

block Array | TypedArray <optional>
<nullable>
null

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

Classes

FeatureSetEnrichmentStandalone

Methods

computeEnrichment(markers, group, effect_size, summary) → {object}

Description:
  • Compute enrichment of top markers in each feature set. It is assumed that the ready method has already resolved before calling this method.

Source:
Parameters:
Name Type Description
markers external:ScoreMarkersResults

Marker detection results for an RNA modality.

group number

Group index of interest.

effect_size string

Effect size to use for ranking. This should be one of "cohen", "auc", "lfc" or "delta_detected".

summary string

Summary statistic to use for ranking. This should be one of "min", "mean" or "min_rank".

Returns:

Object containing statistics for the enrichment of the top marker genes in each feature set. See FeatureSetEnrichmentStandalone.computeEnrichment for more details.

Type
object

computePerCellScores(set_id) → {Object}

Description:
  • Compute per-cell scores for the activity of a feature set. It is assumed that the ready method has already resolved before calling this method.

Source:
Parameters:
Name Type Description
set_id number

Feature set ID, defined as an index into the arrays returned by fetchSetDetails.

Returns:

Object containing the per-cell scores for the feature set activity. See FeatureSetEnrichmentStandalone.computePerCellScores for more details.

Type
Object

fetchCollectionDetails() → {object}

Description:
  • Obtain the details about the feature set collections in the reference database. It is assumed that the ready method has already resolved before calling this method.

Source:
Returns:

Object containing the details about the available feature set collections, see FeatureSetEnrichmentStandalone.fetchCollectionDetails for more details.

Type
object

fetchFeatureSetIndices(set_id) → {Int32Array}

Description:
  • Extract row indices of the members of a desired feature set of interest. It is assumed that the ready method has already resolved before calling this method.

Source:
Parameters:
Name Type Description
set_id number

Feature set ID, defined as an index into the arrays returned by fetchSetDetails.

Returns:

Array containing the row indices of the RNA count matrix corresponding to the genes in the specified set.

Type
Int32Array

fetchParameters() → {object}

Source:
Returns:

Object containing the parameters.

Type
object

fetchSetDetails() → {object}

Description:
  • Obtain the details about the feature sets in the reference database. It is assumed that the ready method has already resolved before calling this method.

Source:
Returns:

Object containing the details about the available feature sets, see FeatureSetEnrichmentStandalone.fetchSetDetails for more details.

Type
object

fetchUniverseSize() → {number}

Description:
  • Obtain the size of the universe of features that were successfully mapped to features in the reference database. It is assumed that the ready method has already resolved before calling this method.

Source:
Returns:

Number of features from the input dataset that were successfully mapped to at least one gene in the reference database.

Type
number

free()

Description:
  • Frees all resources associated with this instance.

Source:

(async) ready()

Description:
  • This should be called after construction and/or setParameters. Users should wait for the return value to resolve before calling any other methods of this class.

Source:
Returns:

Feature set collections are loaded into memory.

setParameters(parameters)

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

Source:
Parameters:
Name Type Description
parameters object

Parameter object.

Properties
Name Type Attributes Description
guess_ids boolean

Automatically choose feature-based parameters based on the feature annotation for the RNA modality. If true, the column of the annotation that best matches human/mouse Ensembl/symbols is identified and used to set species, gene_id_column, gene_id_type.

species Array

Array of strings specifying zero, one or more species involved in this dataset. Each entry should be a taxonomy ID (e.g. "9606", "10090") supported by gesel. This is used internally to filter collections to the entries relevant to these species. Ignored if guess_ids = true.

gene_id_column string | number <nullable>

Name or index of the column of the annotations (supplied in the constructor) containing the identity of each gene. If null, identifiers are taken from the row names. Ignored if guess_ids = true.

gene_id_type string

Type of feature identifier in gene_id_column. This should be one of "ENSEMBL", "SYMBOL" or "ENTREZ" Ignored if guess_ids = true.

top_markers number

Number of top markers to use when testing for enrichment.

Returns:

The object is updated with new parameters. Note that the ready method should be called in order for the new parameters to take effect.

(static) defaults() → {object}

Source:
Returns:

Default parameters that may be modified and fed into compute.

Type
object