View source: R/Seurat.Utils.Visualization.R
PctCellsExpressingGenes | R Documentation |
Calculates the proportion of cells expressing one or more specified genes using a Seurat object as input.
PctCellsExpressingGenes(
genes,
obj,
assay = "RNA",
min.expr = 1,
ident = NULL,
max.idents = 100
)
genes |
A character vector specifying the genes of interest. Must be a non-empty character vector. |
obj |
A Seurat object containing single-cell data. |
assay |
The assay to use for expression data. Default: "RNA". |
min.expr |
The minimum expression level to consider a gene as "expressed". Default: 1. |
ident |
A categorical variable from the metadata of the Seurat object. If NULL, returns overall proportions. Default: NULL. |
max.idents |
Maximum number of unique values allowed in the |
A named vector if ident
is NULL, containing the proportion of cells co-expressing all genes
(AND), the proportion expressing any gene (OR), and the proportion expressing each gene individually.
If ident
is provided, returns a matrix with rows representing categories and columns representing
expression proportions.
## Not run:
# Load the Seurat object (example)
library(Seurat)
combined.obj <- readRDS("path/to/your/seurat_object.rds")
# Define genes of interest
# Define genes of interest
genes <- c("TOP2A", "MAP2")
# Call the function
PctCellsExpressingGenes(genes = genes, obj = combined.obj)
# Call the function with ident
#' PctCellsExpressingGenes(genes = genes, obj = combined.obj, ident = "cluster")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.