Register feature set collections
Source:R/registerFeatureSetCollections.R
registerFeatureSetCollections.Rd
Register feature set collations and their annotations for display in FeatureSetTables.
Usage
registerFeatureSetCollections(se, collections)
registerFeatureSetCommands(se, commands)
getFeatureSetCollections(se)
getFeatureSetCommands(se)
Arguments
- se
The SummarizedExperiment object to be used in
iSEE
.- collections
A named list containing one or more CharacterList objects. Each entry represents a collection of feature sets (see Details) and should be named.
- commands
A named list containing two character vectors of commands to use to generate collections and sets.
Value
For registerFeatureSetCollections
and registerFeatureSetCommands
,
a modified se
is returned that contains the feature set collections or commands, respectively.
This can be used with FeatureSetTables in iSEE
calls.
For getFeatureSetCollections
, the list of CharacterLists is returned.
Alternatively NULL
, if no such list was stored by registerFeatureSetCollections
.
For getFeatureSetCommands
, the list of of commands is returned containing collections
and sets
.
Alternatively NULL
, if no such list was stored by registerFeatureSetCommands
.
Details
Arbitrary feature sets are challenging as there is no obvious place to store them.
registerFeatureSetCollections
and friends will insert these sets into the metadata
of the SummarizedExperiment object,
allowing the corresponding getter functions to quickly extract them later within the iSEE
app.
collections
should be a named list containing CharacterList objects.
Each CharacterList represents a collection where each entry is a feature set, i.e., a character vector corresponding to some of the row names of se
.
The mcols
can contain additional per-set fields (e.g., descriptions, enrichment statistics) that will be shown in the FeatureSetTable.
commands
should be a list containing:
collections
, a named character vector where each entry is named after a feature set collection. Each entry should be a string containing R commands to define a data.frame namedtab
, where each row is a feature set and the row names are the names of those sets.sets
, a character vector where each entry is named after a feature set collection in the same order ascommands$collections
. Each entry should be a string containing R commands to define a character vector namedselected
containing the identity of all rows of the SummarizedExperiment in the set of interest. (These commands can assume that a.set_id
variable is present containing the name of the chosen feature set, as well as these
variable containing the input SummarizedExperiment object.)
If neither collections
nor commands
are provided, any previously registered content in se
is removed.
Examples
library(scRNAseq)
sce <- LunSpikeInData(location=FALSE)
# Make up some random collections.
random <- CharacterList(
Aaron = sample(rownames(sce), 10),
Kevin = sample(rownames(sce), 20),
Charlotte = sample(rownames(sce), 30),
Fed = sample(rownames(sce), 40)
)
mcols(random)$p.value <- runif(4)
# Storing the collections inside our SummarizedExperiment.
sce <- registerFeatureSetCollections(sce, list(random=random))
getFeatureSetCollections(sce)
#> $random
#> CharacterList of length 4
#> [["Aaron"]] ENSMUSG00000102057 ENSMUSG00000088735 ... ENSMUSG00000073413
#> [["Kevin"]] ENSMUSG00000104566 ENSMUSG00000022466 ... ENSMUSG00000094020
#> [["Charlotte"]] ENSMUSG00000060771 ENSMUSG00000051456 ... ENSMUSG00000101854
#> [["Fed"]] ENSMUSG00000099145 ENSMUSG00000027088 ... ENSMUSG00000091734
#>
if (interactive()) {
iSEE(sce, initial=list(FeatureSetTable()))
}