This function performs cell scoring on a Seurat object. It calculates scores for a given set of features and adds the scores as metadata to the Seurat object.
Usage
CellScoring(
srt,
features = NULL,
layer = "data",
assay = NULL,
split.by = NULL,
IDtype = "symbol",
species = "Homo_sapiens",
db = "GO_BP",
termnames = NULL,
db_update = FALSE,
db_version = "latest",
convert_species = TRUE,
Ensembl_version = 103,
mirror = NULL,
minGSSize = 10,
maxGSSize = 500,
method = "Seurat",
classification = TRUE,
name = "",
new_assay = FALSE,
BPPARAM = BiocParallel::bpparam(),
seed = 11,
...
)
Arguments
- srt
A Seurat object
- features
A named list of feature lists for scoring. If NULLL,
db
will be used to create features sets.- layer
The layer of the Seurat object to use for scoring. Defaults to "data".
- assay
The assay of the Seurat object to use for scoring. Defaults to NULL, in which case the default assay of the object is used.
- split.by
A cell metadata variable used for splitting the Seurat object into subsets and performing scoring on each subset. Defaults to NULL.
- IDtype
A character vector specifying the type of gene IDs in the
srt
object orgeneID
argument. This argument is used to convert the gene IDs to a different type ifIDtype
is different fromresult_IDtype
.- species
A character vector specifying the species for which the analysis is performed.
- db
A character vector specifying the name of the database to be used for enrichment analysis.
- termnames
A vector of term names to be used from the database. Defaults to NULL, in which case all features from the database are used.
- db_update
A logical value indicating whether the gene annotation databases should be forcefully updated. If set to FALSE, the function will attempt to load the cached databases instead. Default is FALSE.
- db_version
A character vector specifying the version of the database to be used. This argument is ignored if
db_update
isTRUE
. Default is "latest".- convert_species
A logical value indicating whether to use a species-converted database when the annotation is missing for the specified species. The default value is TRUE.
- Ensembl_version
Ensembl database version. If NULL, use the current release version.
- mirror
Specify an Ensembl mirror to connect to. The valid options here are 'www', 'uswest', 'useast', 'asia'.
- minGSSize
A numeric value specifying the minimum size of a gene set to be considered in the enrichment analysis.
- maxGSSize
A numeric value specifying the maximum size of a gene set to be considered in the enrichment analysis.
- method
The method to use for scoring. Can be "Seurat", "AUCell", or "UCell". Defaults to "Seurat".
- classification
Whether to perform classification based on the scores. Defaults to TRUE.
- name
The name of the assay to store the scores in. Only used if new_assay is TRUE. Defaults to an empty string.
- new_assay
Whether to create a new assay for storing the scores. Defaults to FALSE.
- BPPARAM
The BiocParallel parameter object. Defaults to
BiocParallel::bpparam()
.- seed
The random seed for reproducibility. Defaults to 11.
- ...
Additional arguments to be passed to the scoring methods.