Classes
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 Properties
|
Returns:
The state is updated with new results.
computeEnrichment(markers, group, effect_size, summary) → {object}
- Description:
Compute enrichment of top markers in each feature set. It is assumed that
runAnalysis
was already run on this FeatureSetEnrichmentState instance before calling this method.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
markers |
external:ScoreMarkersResults | Arbitrary marker detection results for an RNA modality, with the same order and identity of genes as from the upstream InputsState.
This is most typically the output from |
group |
number | Index of the group of interest inside |
effect_size |
string | Effect size to use for ranking.
This should be one of |
summary |
string | Summary statistic to use for ranking.
This should be one of |
Returns:
Object containing the following properties:
set_ids
: Int32Array of length equal to the number of sets, containing the set IDs. Each entry is an index into the arrays returned byfetchSetDetails
.counts
: Int32Array of length equal toset_ids
, containing the number of markers present in each set.pvalues
: Float64Array of length equal tocounts
, containing the enrichment p-values for each set.num_markers
: number of markers selected for testing.
Sets are guaranteed to be sorted by increasing p-value in pvalues
.
- Type
- object
computePerCellScores(set_id) → {Object}
- Description:
Compute per-cell scores for the activity of a feature set. It is assumed that
runAnalysis
was already run on this FeatureSetEnrichmentState instance before calling this method.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
set_id |
number | Feature set ID, defined as an index into the arrays returned by |
Returns:
Object containing:
indices
: Int32Array containing the row indices of the genes in the set, relative to the RNA count matrix.weights
: Float64Array containing the weights of each gene in the set.scores
: Float64Array containing the feature set score for each cell.
- Type
- Object
fetchCollectionDetails() → {object}
- Description:
Obtain the details about the feature set collections in the reference database. It is assumed that
runAnalysis
was already run on this FeatureSetEnrichmentState instance before calling this method.
- Source:
Returns:
Object with the following properties:
names
: Array of strings of length equal to the number of feature set collections, containing the names of the collections.descriptions
: Array of strings of length equal tonames
, containing the descriptions for all collections.species
: Array of strings of length equal tonames
, containing the taxonomy IDs for all collections.
- Type
- object
fetchFeatureSetIndices(set_id) → {Int32Array}
- Description:
Extract row indices of the members of a desired feature set of interest. It is assumed that
runAnalysis
was already run on this FeatureSetEnrichmentState instance before calling this method.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
set_id |
number | Feature set ID, defined as an index into the arrays returned by |
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
runAnalysis
was already run on this FeatureSetEnrichmentState instance before calling this method.
- Source:
Returns:
Object with the following properties:
names
: Array of strings of length equal to the number of feature sets across all collections, containing the names of those sets.descriptions
: Array of strings of length equal tonames
, containing the set descriptions.sizes
: Int32Array of length equal tonames
, containing the set sizes. Each set's size is defined as the number of features in the dataset that are successfully mapped to a member of the set.collections
: Int32Array of length equal tonames
, specifying the collection to which the set belongs. This is interpreted as the index of the arrays infetchCollectionDetails
.
- 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
runAnalysis
was already run on this FeatureSetEnrichmentState instance 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:
(static) defaults() → {object}
- Source:
Returns:
Default parameters that may be modified and fed into compute
.
- Type
- object