get_lfc_celltype: Get log fold change values of genes in cell type of interest

View source: R/application_prediction.R

get_lfc_celltypeR Documentation

Get log fold change values of genes in cell type of interest

Description

get_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", expression_pct = 0.10)
#'

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.

expression_pct

To consider only genes if they are expressed in at least a specific fraction of cells of a cluster. This number indicates this fraction. Default: 0.10

Value

A tbl with the log fold change values of genes. Positive lfc values: higher in condition_oi compared to condition_reference.

Examples

## Not run: 
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)

## End(Not run)

saeyslab/nichenetr documentation built on March 26, 2024, 9:22 a.m.