Description Usage Arguments Details Value Author(s) See Also Examples
Swap the main Experiment for an alternative Experiment in a SingleCellExperiment object.
1 | swapAltExp(x, name, saved = NULL, withColData = TRUE)
|
x |
A SingleCellExperiment object. |
name |
String or integer scalar specifying the alternative Experiment to use to replace the main Experiment. |
saved |
String specifying the name to use to save the original |
withColData |
Logical scalar specifying whether the column metadata of |
During the course of an analysis, we may need to perform operations on each of the alternative Experiments in turn.
This would require us to repeatedly call altExp(x, name)
prior to running downstream functions on those Experiments.
In such cases, it may be more convenient to switch the main Experiment with the desired alternative Experiments,
allowing a particular section of the analysis to be performed on the latter by default.
For example, the initial phases of the analysis might use the entire set of features. At some point, we might want to focus only on a subset of features of interest, but we do not want to discard the rest of the features. This can be achieved by storing the subset as an alternative Experiment and swapping it with the main Experiment, as shown in the Examples below.
A SingleCellExperiment derived from altExp(x, name)
.
This contains all alternative Experiments in altExps(x)
,
with an additional entry containing x
if saved
is specified.
If withColData=TRUE
, the column metadata is set to colData(x)
.
Aaron Lun
altExps
, for a description of the alternative Experiment concept.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | example(SingleCellExperiment, echo=FALSE) # using the class example
# Let's say we defined a subset of genes of interest.
# We can save the feature set as its own altExp.
hvgs <- 1:10
altExp(sce, "subset") <- sce[hvgs,]
# At some point, we want to do our analysis on the HVGs only,
# but we want to hold onto the other features for later reference.
sce <- swapAltExp(sce, name="subset", saved="all")
sce
# Once we're done, it is straightforward to switch back.
swapAltExp(sce, "all")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.