Get log fold change values of genes in cell type of interest
Source:R/application_prediction.R
get_lfc_celltype.Rdget_lfc_celltype Get log fold change of genes between two conditions in cell type of interest when using a Seurat single-cell object.
Usage
get_lfc_celltype(celltype_oi, seurat_obj, condition_colname, condition_oi, condition_reference, celltype_col = "celltype")
#'Arguments
- celltype_oi
Name of celltype of interest. Should be present in the celltype metadata dataframe.
- seurat_obj
Single-cell expression dataset as Seurat object https://satijalab.org/seurat/.
- condition_colname
Name of the column in the meta data dataframe that indicates which condition/sample cells were coming from.
- condition_oi
Condition of interest. Should be a name present in the "condition_colname" column of the metadata.
- condition_reference
The second condition (e.g. reference or steady-state condition). Should be a name present in the "condition_colname" column of the metadata.
- celltype_col
Metadata colum name where the cell type identifier is stored. Default: "celltype". If this is NULL, the Idents() of the seurat object will be considered as your cell type identifier.
- ...
Additional arguments passed to
FindMarkers.
Value
A tbl with the log fold change values of genes. Positive lfc values: higher in condition_oi compared to condition_reference.
Examples
if (FALSE) { # \dontrun{
requireNamespace("dplyr")
seuratObj <- readRDS(url("https://zenodo.org/record/3531889/files/seuratObj_test.rds"))
get_lfc_celltype(seurat_obj = seuratObj, celltype_oi = "CD8 T", condition_colname = "aggregate", condition_oi = "LCMV", condition_reference = "SS", celltype_col = "celltype", expression_pct = 0.10)
} # }