FindExpressedMarkers
Usage
FindExpressedMarkers(
object,
ident.1 = NULL,
ident.2 = NULL,
cells.1 = NULL,
cells.2 = NULL,
features = NULL,
assay = NULL,
layer = "data",
min.expression = 0,
test.use = "wilcox",
logfc.threshold = 0.25,
base = 2,
pseudocount.use = 1,
mean.fxn = NULL,
fc.name = NULL,
min.pct = 0.1,
min.diff.pct = -Inf,
max.cells.per.ident = Inf,
latent.vars = NULL,
only.pos = FALSE,
min.cells.group = 3,
min.cells.feature = 3,
norm.method = "LogNormalize",
seed = 11,
verbose = TRUE,
...
)
Arguments
- object
An object
- ident.1
Identity class to define markers for; pass an object of class
phylo
or 'clustertree' to find markers for a node in a cluster tree; passing 'clustertree' requiresBuildClusterTree
to have been run- ident.2
A second identity class for comparison; if
NULL
, use all other cells for comparison; if an object of classphylo
or 'clustertree' is passed toident.1
, must pass a node to find markers for- cells.1
Vector of cell names belonging to group 1
- cells.2
Vector of cell names belonging to group 2
- features
Genes to test. Default is to use all genes
- assay
Assay to use in differential expression testing
- layer
The layer used.
- min.expression
The min.expression used.
- test.use
Denotes which test to use. Available options are:
"wilcox" : Identifies differentially expressed genes between two groups of cells using a Wilcoxon Rank Sum test (default); will use a fast implementation by Presto if installed
"wilcox_limma" : Identifies differentially expressed genes between two groups of cells using the limma implementation of the Wilcoxon Rank Sum test; set this option to reproduce results from Seurat v4
"bimod" : Likelihood-ratio test for single cell gene expression, (McDavid et al., Bioinformatics, 2013)
"roc" : Identifies 'markers' of gene expression using ROC analysis. For each gene, evaluates (using AUC) a classifier built on that gene alone, to classify between two groups of cells. An AUC value of 1 means that expression values for this gene alone can perfectly classify the two groupings (i.e. Each of the cells in cells.1 exhibit a higher level than each of the cells in cells.2). An AUC value of 0 also means there is perfect classification, but in the other direction. A value of 0.5 implies that the gene has no predictive power to classify the two groups. Returns a 'predictive power' (abs(AUC-0.5) * 2) ranked matrix of putative differentially expressed genes.
"t" : Identify differentially expressed genes between two groups of cells using the Student's t-test.
"negbinom" : Identifies differentially expressed genes between two groups of cells using a negative binomial generalized linear model. Use only for UMI-based datasets
"poisson" : Identifies differentially expressed genes between two groups of cells using a poisson generalized linear model. Use only for UMI-based datasets
"LR" : Uses a logistic regression framework to determine differentially expressed genes. Constructs a logistic regression model predicting group membership based on each feature individually and compares this to a null model with a likelihood ratio test.
"MAST" : Identifies differentially expressed genes between two groups of cells using a hurdle model tailored to scRNA-seq data. Utilizes the MAST package to run the DE testing.
"DESeq2" : Identifies differentially expressed genes between two groups of cells based on a model using DESeq2 which uses a negative binomial distribution (Love et al, Genome Biology, 2014).This test does not support pre-filtering of genes based on average difference (or percent detection rate) between cell groups. However, genes may be pre-filtered based on their minimum detection rate (min.pct) across both cell groups. To use this method, please install DESeq2, using the instructions at https://bioconductor.org/packages/release/bioc/html/DESeq2.html
- logfc.threshold
Limit testing to genes which show, on average, at least X-fold difference (log-scale) between the two groups of cells. Default is 0.1 Increasing logfc.threshold speeds up the function, but can miss weaker signals. If the
slot
parameter is "scale.data" no filtering is performed.- base
The base with respect to which logarithms are computed.
- pseudocount.use
Pseudocount to add to averaged expression values when calculating logFC. 1 by default.
- mean.fxn
Function to use for fold change or average difference calculation. The default depends on the the value of
fc.slot
:"counts" : difference in the log of the mean counts, with pseudocount.
"data" : difference in the log of the average exponentiated data, with pseudocount. This adjusts for differences in sequencing depth between cells, and assumes that "data" has been log-normalized.
"scale.data" : difference in the means of scale.data.
- fc.name
Name of the fold change, average difference, or custom function column in the output data.frame. If NULL, the fold change column will be named according to the logarithm base (eg, "avg_log2FC"), or if using the scale.data slot "avg_diff".
- 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.01
- min.diff.pct
only test genes that show a minimum difference in the fraction of detection between the two groups. Set to -Inf by default
- max.cells.per.ident
Down sample each identity class to a max number. Default is no downsampling. Not activated by default (set to Inf)
- latent.vars
Variables to test, used only when
test.use
is one of 'LR', 'negbinom', 'poisson', or 'MAST'- only.pos
Only return positive markers (FALSE by default)
- min.cells.group
Minimum number of cells in one of the groups
- min.cells.feature
Minimum number of cells expressing the feature in at least one of the two groups, currently only used for poisson and negative binomial tests
- norm.method
Normalization method for fold change calculation when
slot
is “data
”- seed
The seed used.
- verbose
Print a progress bar once expression testing begins
- ...
Arguments passed to other methods and to specific DE methods
Examples
markers <- FindExpressedMarkers(
pancreas_sub,
cells.1 = SeuratObject::WhichCells(
pancreas_sub,
expression = Phase == "G2M"
)
)
head(markers)
#> p_val avg_log2FC pct.1 pct.2 p_val_adj
#> Hmgb2 2.684289e-38 2.2202786 1.000 0.530 4.282783e-34
#> Cks1b 3.784104e-31 1.3335309 0.971 0.522 6.037537e-27
#> Ran 5.631349e-31 1.1429123 1.000 0.948 8.984817e-27
#> Tuba1b 1.780481e-29 1.7619744 0.986 0.802 2.840757e-25
#> Ptma 5.683319e-29 0.9543981 1.000 0.999 9.067735e-25
#> H2afx 2.324346e-27 1.4622573 0.971 0.520 3.708494e-23
FeatureStatPlot(
pancreas_sub,
rownames(markers)[1],
group.by = "Phase",
add_point = TRUE
)
#> Warning: No shared levels found between `names(values)` of the manual scale and the
#> data's colour values.