Description Usage Arguments Value References
View source: R/differential_expression.R
Uses Seurat::FindMarkers MAST test hurdle model with added random effects variables
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | DE_MAST_RE_seurat(
object,
random_effect.vars,
ident.1 = NULL,
ident.2 = NULL,
cells.1 = NULL,
cells.2 = NULL,
group.by = NULL,
logfc.threshold = 0.25,
base = exp(1),
assay = NULL,
slot = "data",
features = NULL,
min.pct = 0.1,
max.cells.per.ident = NULL,
random.seed = 1,
latent.vars = NULL,
n_cores = NULL,
verbose = TRUE,
p.adjust.method = "fdr",
...
)
|
object |
Seurat >=3 object, with log-normalized data in the 'data' slot |
random_effect.vars |
Character vector of variables to add as random intersects in MAST model i.e. ~ ... + (1|random_effect.var1) + (1|random_effect.var2) |
ident.1 |
Identity class to define markers for |
ident.2 |
A second identity class for comparison. Leave as NULL to compare with all other cells |
cells.1 |
Vector of cell names belonging to group 1. Alternative way to specify ident.1 |
cells.2 |
Vector of cell names belonging to group 2. Alternative way to specify ident.2 |
group.by |
Regroup cells into a different identity class prior to performing differential expression |
logfc.threshold |
Only return results with a DE exceeding threshold |
base |
base for log when computing mean and for output, default exp(1). NB: Seurat has changed to log2 in V4. |
assay |
Assay to pull data from; defaults to default assay |
slot |
Slot to pull data from; defaults to "data" as MAST expects log-normalized data |
features |
Genes to test. Default is to use all genes |
min.pct |
Only test genes that are detected in a minimum fraction of min.pct cells in either of the two populations. Meant to speed up the function by not testing genes that are very infrequently expressed. Default is 0.1 |
max.cells.per.ident |
Downsample each identity class to a max number. Default is no downsampling. Not activated by default (set to Inf) |
random.seed |
Random seed to use for down sampling |
latent.vars |
Variables to test |
n_cores |
How many cores to use (temporarily sets options(mc.cores=n_cores)) |
verbose |
whether to print stdout from MAST functions |
p.adjust.method |
passed to p.adjust. Note that n is all the genes in the object |
... |
Additional parameters (other than formula, sca, method, ebayes, strictConvergence) to pass to MAST::zlm |
data.frame with column names p_val, avg_log[base]FC, pct.1, pct.2, p_val_adj (identical format to Seurat::FindMarkers)
Zimmerman, K.D., Espeland, M.A. & Langefeld, C.D. . A practical solution to pseudoreplication bias in single-cell studies. . Nat Commun 12, 738 (2021). https://doi.org/10.1038/s41467-021-21038-1
. McDavid A, Finak G, Yajima M (2020). MAST: Model-based Analysis of Single Cell Transcriptomics. R package version 1.16.0, https://github.com/RGLab/MAST/.
. Stuart and Butler et al. Comprehensive Integration of Single-Cell Data. Cell (2019)
. Seurat 3 source at https://github.com/satijalab/seurat/blob/master/R/differential_expression.R
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.