| pseudobulk_within | R Documentation |
Splits the pseudobulks by split_var and, within each split level,
fits a DESeq2 model whose contrast variable is the second term of
dge_formula. Used to test for an effect (e.g. case vs. control)
restricted to one cluster at a time, where pooling across clusters
would mix biology and batch.
pseudobulk_within(
dge_formula,
counts_df,
meta_data,
split_var,
vals_test,
verbose,
min_counts_per_sample,
present_in_min_samples
)
dge_formula |
One-sided formula such as |
counts_df |
Feature-by-pseudobulk integer count matrix. Rows
are features; columns must align with rows of |
meta_data |
data.frame of pseudobulk metadata. One row per
pseudobulk; should contain only the variables used in
|
split_var |
Name of the column in |
vals_test |
Character vector of contrast levels to test. If
|
verbose |
Logical. Print progress messages. Default |
min_counts_per_sample |
Minimum count per pseudobulk for a
gene to be considered expressed in that pseudobulk. Default |
present_in_min_samples |
Minimum number of pseudobulks in
which a gene must reach |
Two-level contrasts (factor or character) yield the standard
<var>_<level2>_vs_<level1> Wald coefficient. Three or more levels
are integer-encoded and the fit returns an ordinal trend. Most
users should call pseudobulk_deseq2() with mode = "within"
rather than this function directly. See the pseudobulk vignette
for a worked example using case-vs-control DGE within each cell
cluster.
data.frame of DESeq2 results with columns group (the
value of split_var), feature, baseMean, log2FoldChange,
lfcSE, stat, pvalue, padj.
pseudobulk_deseq2(), pseudobulk_one_vs_all(),
pseudobulk_pairwise()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.