View source: R/run_scfeatures.R
run_pathway_gsva | R Documentation |
This function calculates pathway scores for a given input dataset and gene set using gene set enrichment analysis (GSVA). It supports scRNA-seq, spatial proteomics and spatial transcriptomics. It currently supports two pathway analysis methods: ssgsea and aucell. By default, it uses the 50 hallmark gene sets from msigdb. Alternatively, users can provide their own gene sets of interest in a list format.
run_pathway_gsva(
data,
method = "ssgsea",
geneset = NULL,
species = "Homo sapiens",
type = "scrna",
subsample = TRUE,
ncores = 1
)
data |
A list object containing |
method |
Type of pathway analysis method, currently support |
geneset |
By default (when the |
species |
Whether the species is "Homo sapiens" or "Mus musculus". Default is "Homo sapiens". |
type |
The type of dataset, either "scrna", "spatial_t", or "spatial_p". |
subsample |
Whether to subsample, either TRUE or FALSE. For larger datasets (eg, over 30,000 cells), the subsample function can be used to increase speed. |
ncores |
Number of cores for parallel processing. |
a dataframe of samples x features The features are in the form of pathway 1 celltype a, pathway 2 celltype b ... etc, with the number representing the gene set enrichment score of a given pathway in cells from a given celltype.
utils::data("example_scrnaseq" , package = "scFeatures")
data <- example_scrnaseq[, 1:20]
celltype <- data$celltype
sample <- data$sample
data <- data@assays$RNA@data
alldata <- scFeatures:::formatData(data = data, celltype = celltype, sample = sample )
feature_pathway_gsva <- run_pathway_gsva(
alldata,
geneset = NULL, species = "Homo sapiens",
type = "scrna", subsample = FALSE, ncores = 1
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.