runDS | R Documentation |
Test for differential state of entities using functions from the
edgeR
package. This adapts edgerWrp
to accept
input as a
SummarizedExperiment
(SE) object
instead of matrix
. Each assay
should correspond to data
for one node of the tree. Samples are in columns and
features are in rows. The sample information is
in colData
. The tree that stores the hierarchical relation between
the assays
is provided via the argument tree
.
runDS(
SE,
tree,
option = c("glm", "glmQL"),
design = NULL,
contrast = NULL,
filter_min_count = 1,
filter_min_total_count = 15,
filter_large_n = 10,
filter_min_prop = 1,
min_cells = 10,
normalize = TRUE,
normalize_method = "TMM",
group_column = "group_id",
design_terms = "group_id",
message = TRUE,
...
)
SE |
A |
tree |
A |
option |
Either |
design |
A numeric design matrix. If |
contrast |
A numeric vector specifying one contrast of
the linear model coefficients to be tested equal to zero. Its length
must equal to the number of columns of design. If |
filter_min_count |
A numeric value, passed to min.count of
|
filter_min_total_count |
A numeric value, passed to
min.total.count of |
filter_large_n |
A numeric value, passed to large.n of
|
filter_min_prop |
A numeric value, passed to min.prop of
|
min_cells |
A numeric scalar specifying the minimal number of cells
in a node required to include a node in the analysis. The information
about the number of cells per node and sample should be available in
|
normalize |
A logical scalar indicating whether to estimate
normalization factors (using |
normalize_method |
Normalization method to be used. See
|
group_column |
The name of the column in the sample annotation providing group labels for samples. This annotation is used for filtering. |
design_terms |
The names of columns from the sample annotation that will be used to generate the design matrix. This is ignored if design is provided. |
message |
A logical scalar, indicating whether progress messages should be printed. |
... |
More arguments to pass to |
A list with entries edgeR_results, tree, and nodes_drop.
A list. Each of the elements contains the output of
glmQLFTest
or
glmLRT
for one node, depending on the specified
option
.
The hierarchical structure of entities that was stored in the
input SE
.
A vector storing the alias node labels of entities that are filtered before analysis due to low counts.
Ruizhu Huang
suppressPackageStartupMessages({
library(TreeSummarizedExperiment)
})
## Load example data
ds_tse <- readRDS(system.file("extdata", "ds_sim_20_500_8de.rds",
package = "treeclimbR"))
ds_se <- aggDS(TSE = ds_tse, assay = "counts", sample_id = "sample_id",
group_id = "group", cluster_id = "cluster_id", FUN = sum)
## Information about the number of cells is provided in the metadata
S4Vectors::metadata(ds_se)$n_cells
ds_res <- runDS(SE = ds_se, tree = colTree(ds_tse), option = "glmQL",
group_column = "group", contrast = c(0, 1),
filter_min_count = 0, filter_min_total_count = 1,
design = model.matrix(~ group, data = colData(ds_se)),
filter_min_prop = 0, min_cells = 5, message = FALSE)
## Top differential features (across nodes)
nodeResult(ds_res, type = "DS")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.