Learn R Programming

nichenetr (version 0.1.0)

get_lfc_celltype: 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, 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 v3 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.

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

Run this code
# NOT RUN {
library(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", expression_pct = 0.10)
# }

Run the code above in your browser using DataLab