View source: R/prioritization.R
get_exprs_avg | R Documentation |
get_exprs_avg
Calculate average of gene expression per cell type. If condition_oi is provided, only consider cells from that condition.
get_exprs_avg(
seurat_obj,
celltype_colname,
condition_oi = NULL,
condition_colname = NULL,
assay_oi = NULL,
...
)
seurat_obj |
Seurat object |
celltype_colname |
Name of the meta data column that indicates the cell type of a cell |
condition_oi |
If provided, subset seurat_obj so average expression is only calculated for cells belonging to condition_oi |
condition_colname |
Name of the meta data column that indicates from which group/condition a cell comes from |
assay_oi |
Which assay need to be used for DE calculation. If NULL, will use |
... |
Arguments passed to Seurat::AverageExpression, usually for slot/layer to use (default: data) |
Data frame with average gene expression per cell type.
## Not run:
seurat_obj = readRDS(url("https://zenodo.org/record/3531889/files/seuratObj.rds"))
seurat_obj$celltype <- make.names(seuratObj$celltype)
# Calculate average expression across conditions
expression_info = get_exprs_avg(seurat_obj, "celltype")
# Calculate LCMV-specific average expression
expression_info = get_exprs_avg(seurat_obj, "celltype", condition_oi = "LCMV", condition_colname = "aggregate")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.