This function identifies the top expressed genes either globally or grouped by sample and/or cell type. Useful for finding marker genes or highly expressed pathogen genes.
Usage
GetTopGenes(
STID_obj,
top_n = 10,
pattern = NULL,
grp_by_samp = FALSE,
grp_by_celltype = FALSE,
assay_id = "Spatial",
layer_id = "counts"
)Arguments
- STID_obj
A Seurat or STID object
- top_n
Numeric, number of top genes to return (default: 10)
- pattern
Character, regular expression pattern to filter genes (default: NULL)
- grp_by_samp
Logical, whether to group by sample (default: FALSE)
- grp_by_celltype
Logical, whether to group by cell type (default: FALSE)
- assay_id
Character, name of the assay to use (default: "Spatial")
- layer_id
Character, name of the layer/data slot to use (default: "counts")