FoldChange {Seurat} | R Documentation |
Fold Change
Description
Calculate log fold change and percentage of cells expressing each feature for different identity classes.
Usage
FoldChange(object, ...)
## Default S3 method:
FoldChange(object, cells.1, cells.2, mean.fxn, fc.name, features = NULL, ...)
## S3 method for class 'Assay'
FoldChange(
object,
cells.1,
cells.2,
features = NULL,
slot = "data",
pseudocount.use = 1,
fc.name = NULL,
mean.fxn = NULL,
base = 2,
norm.method = NULL,
...
)
## S3 method for class 'SCTAssay'
FoldChange(
object,
cells.1,
cells.2,
features = NULL,
slot = "data",
pseudocount.use = 1,
fc.name = NULL,
mean.fxn = NULL,
base = 2,
...
)
## S3 method for class 'DimReduc'
FoldChange(
object,
cells.1,
cells.2,
features = NULL,
slot = NULL,
pseudocount.use = 1,
fc.name = NULL,
mean.fxn = NULL,
...
)
## S3 method for class 'Seurat'
FoldChange(
object,
ident.1 = NULL,
ident.2 = NULL,
group.by = NULL,
subset.ident = NULL,
assay = NULL,
slot = "data",
reduction = NULL,
features = NULL,
pseudocount.use = 1,
mean.fxn = NULL,
base = 2,
fc.name = NULL,
...
)
Arguments
object |
A Seurat object |
... |
Arguments passed to other methods |
cells.1 |
Vector of cell names belonging to group 1 |
cells.2 |
Vector of cell names belonging to group 2 |
mean.fxn |
Function to use for fold change or average difference calculation |
fc.name |
Name of the fold change, average difference, or custom function column in the output data.frame |
features |
Features to calculate fold change for. If NULL, use all features |
slot |
Slot to pull data from |
pseudocount.use |
Pseudocount to add to averaged expression values when calculating logFC. |
base |
The base with respect to which logarithms are computed. |
norm.method |
Normalization method for mean function selection
when |
ident.1 |
Identity class to calculate fold change for; pass an object of class
|
ident.2 |
A second identity class for comparison; if |
group.by |
Regroup cells into a different identity class prior to
calculating fold change (see example in |
subset.ident |
Subset a particular identity class prior to regrouping.
Only relevant if group.by is set (see example in |
assay |
Assay to use in fold change calculation |
reduction |
Reduction to use - will calculate average difference on cell embeddings |
Details
If the slot is scale.data
or a reduction is specified, average difference
is returned instead of log fold change and the column is named "avg_diff".
Otherwise, log2 fold change is returned with column named "avg_log2_FC".
Value
Returns a data.frame
See Also
FindMarkers
Examples
## Not run:
data("pbmc_small")
FoldChange(pbmc_small, ident.1 = 1)
## End(Not run)