filterTrajFeaturesByCOV {CellTrails} | R Documentation |
Filters trajectory features by their coefficient of variation.
filterTrajFeaturesByCOV(sce, threshold, design = NULL, show_plot = TRUE)
sce |
An |
threshold |
Minimum coefficient of variation; numeric value between 0 and 1 |
design |
A numeric matrix describing the factors that should be blocked |
show_plot |
Indicates if plot should be shown (default: TRUE) |
For each trajectory feature x listed in the
SingleCellExperiment
object the coefficient of variation is
computed by CoV(x) = sd(x) / mean(x). Features with a CoV(x) greater
than threshold
remain labeled as trajectory feature in the
SingleCellExperiment
object, otherwise they are not considered
for dimensionality reduction, clustering and trajectory reconstruction.
Please note that spike-in controls are ignored
and are not listed as trajectory features.
To account for systematic bias in the expression data
(e.g., cell cycle effects), a design matrix can be provided for the
learning process. It should list the factors that should be blocked and
their values per sample. It is suggested to construct a design
matrix with model.matrix
.
A character
vector
Daniel C. Ellwanger
trajFeatureNames
isSpike
model.matrix
# Simulate example data set.seed(1101) dat <- simulate_exprs(n_features=15000, n_samples=100) # Create container alist <- list(logcounts=dat) sce <- SingleCellExperiment(assays=alist) # Filter incrementally trajFeatureNames(sce) <- filterTrajFeaturesByDL(sce, threshold=2) trajFeatureNames(sce) <- filterTrajFeaturesByCOV(sce, threshold=0.5) # Number of features length(trajFeatureNames(sce)) #filtered nrow(sce) #total