Determine expressed genes of a cell type from an input object
Source:R/application_prediction.R
get_expressed_genes.RdReturn the genes that are expressed in given cell cluster(s) based on the fraction of cells in the cluster(s) that should express the cell.
Usage
get_expressed_genes(celltype_oi, object, ...)
# Default S3 method
get_expressed_genes(celltype_oi, object, celltype_annot, pct = 0.1)
# S3 method for class 'Seurat'
get_expressed_genes(celltype_oi, seurat_obj, pct = 0.1, assay_oi = NULL, ...)Arguments
- celltype_oi
Character vector of cell type(s) to be considered. If input is a Seurat object, these must correspond to the cell identities from
Idents.- object
Input matrix with rows as genes and columns as cells
- ...
additional parameters passed to
GetAssayData(in case the slot/layer needs to be specified)- celltype_annot
Vector of cell type annotations
- pct
We consider genes expressed if they are expressed in at least a specific fraction of cells of the given cluster(s). This number indicates this fraction. Default: 0.10. Choice of this parameter is important and depends largely on the used sequencing platform. We recommend to require a lower fraction (like the default 0.10) for 10X data than for e.g. Smart-seq2 data.
- seurat_obj
Single-cell expression or spatial dataset as Seurat object
- assay_oi
If wanted: specify yourself which assay to look for. If not NULL, the
DefaultAssayof the Seurat object is used.
Examples
if (FALSE) { # \dontrun{
# For sparse matrix
get_expressed_genes("CD8 T", GetAssayData(seuratObj), seuratObj$celltype, pct = 0.10)
} # }
if (FALSE) { # \dontrun{
# For Seurat object
get_expressed_genes(celltype_oi = "CD8 T", seurat_obj = seuratObj, pct = 0.10)
} # }