Skip to contents

This function creates signatures (module scores calculated from UCell or Seurat's respective functions) from features found in the Seurat object and extracted from supplied MSigDB's pathways.

Usage

GSEA_Signatures(
  seurat_object,
  assay = "RNA",
  layer = "data",
  species = "Homo sapiens",
  category = NULL,
  subcategory = NULL,
  pathways,
  min.features = 2,
  signatures.names = "name",
  method = "UCell",
  only.features = FALSE,
  fail.safe = 10,
  verbose = TRUE,
  ...
)

Arguments

seurat_object

A Seurat object.

assay

Character. If the Seurat object contains multiple RNA assays, you may specify which one to use (for example 'RNA2' if you have created a second RNA assay you named 'RNA2'. See Seurat v5 vignettes for more information). You may also use another assay such as 'SCT' to pull features expression from.

layer

Character. Formerly known as slot. If you have split layers the function will always join them before searching features and adding the signatures.

species

Character. The species name to be passed to msigdbr to build the pathways database. Use msigdbr_species for the list of available species.

category

Character. The category or categories to be passed to msigdbr to build the pathways database. Use msigdbr_collections for the list of available categories (gs_cat column). If NULL, all categories will be used.

subcategory

Character. The subcategory or subcategories to be passed to msigdbr to build the pathways database. Use msigdbr_collections for the list of available subcategories (gs_subcat column). If NULL, all subcategories will be used.

pathways

Character. The names of the pathways to be used to create the signatures. You may provide either a pathway id (for example, 'GO:0006574') or a name matching the pattern found in gs_name column (all caps and underscores between words). Please note that you may also provide a partial match (for example, 'TYPE_I_INTERFERON') and the function will find all pathways containing this partial string. Beware that this may result in a large number of pathways to be added as signatures (using only.features = TRUE is highly recommended) but is very handy to explore all pathways of interest in a particular biological process.

min.features

Numeric. The minimum number of features present in the Seurat object for a pathway to be considered.

signatures.names

Character. Either 'id' which will add pathways ids as signatures (e.g. GO:0004657, hsa05200 etc), or 'name' which will add pathways names as signatures, which might be very long. You may also provide a vector of custom names to be used as signatures names in the Seurat object, whose length must match the number of pathways. If multiple results are found for a pathway, the function will append a number to the corresponding signature name for each result.

method

Character. The method you want to use to calculate the module scores, either 'UCell' or 'Seurat'.

only.features

Logical. If TRUE, the function will not add any signature to the Seurat object and will only return the Seurat object as well as the features from the pathways found in the Seurat object and the features present in the Seurat object.

fail.safe

Numeric. The maximum number of signatures the function will attempt to add to the Seurat object. If the number of signatures found is higher than this number, the function will not add any signature to the Seurat object and will only return the Seurat object as well as the features from the pathways found in the Seurat object and the features present in the Seurat object.

verbose

Logical. If FALSE, does not print progress messages and output, but warnings and errors will still be printed.

...

Additional arguments to be passed to AddModuleScore_UCell or AddModuleScore.

Value

A list containing the Seurat object with the added signatures if only.features = FALSE, the features from the pathways, the features present in the Seurat object and the names of the signatures in the Seurat object.