splitAltExps | R Documentation |
Split a SingleCellExperiment based on the feature type, creating alternative Experiments to hold features that are not in the majority set.
splitAltExps(x, f, ref = NULL)
x |
A SingleCellExperiment object. |
f |
A character vector or factor of length equal to |
ref |
String indicating which level of |
This function provides a convenient way to create a SingleCellExperiment with alternative Experiments. For example, a SingleCellExperiment with rows corresponding to all features can be quickly split into endogenous genes (main) and other alternative features like spike-in transcripts and antibody tags.
By default, the most frequent level of f
is treated as the ref
if the latter is not specified.
A SingleCellExperiment where each row corresponds to a feature in the main set.
Each other feature type is stored as an alternative Experiment, accessible by altExp
.
ref
is used as the mainExpName
.
Aaron Lun
altExp
, to access and manipulate the alternative Experiment fields.
unsplitAltExps
, to reverse the splitting.
example(SingleCellExperiment, echo=FALSE)
feat.type <- sample(c("endog", "ERCC", "CITE"), nrow(sce),
replace=TRUE, p=c(0.8, 0.1, 0.1))
sce2 <- splitAltExps(sce, feat.type)
sce2
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.