run_fgsea {decoupleR}R Documentation

Fast Gene Set Enrichment Analysis (FGSEA)

Description

Calculates regulatory activities using FGSEA.

Usage

run_fgsea(
  mat,
  network,
  .source = .data$source,
  .target = .data$target,
  times = 100,
  nproc = 4,
  seed = 42,
  ...
)

Arguments

mat

Matrix to evaluate (e.g. expression matrix). Target nodes in rows and conditions in columns. rownames(mat) must have at least one intersection with the elements in network .target column.

network

Tibble or dataframe with edges and it's associated metadata.

.source

Column with source nodes.

.target

Column with target nodes.

times

How many permutations to do?

nproc

Number of cores to use for computation.

seed

A single value, interpreted as an integer, or NULL.

...

Arguments passed on to fgsea::fgseaMultilevel

sampleSize

The size of a random set of genes which in turn has size = pathwaySize

minSize

Minimal size of a gene set to test. All pathways below the threshold are excluded.

maxSize

Maximal size of a gene set to test. All pathways above the threshold are excluded.

eps

This parameter sets the boundary for calculating the p value.

scoreType

This parameter defines the GSEA score type. Possible options are ("std", "pos", "neg")

gseaParam

GSEA parameter value, all gene-level statis are raised to the power of 'gseaParam' before calculation of GSEA enrichment scores.

BPPARAM

Parallelization parameter used in bplapply. Can be used to specify cluster to run. If not initialized explicitly or by setting 'nproc' default value 'bpparam()' is used.

absEps

deprecated, use 'eps' parameter instead

Details

This function is a wrapper for the method fgsea::fgsea.

Value

A long format tibble of the enrichment scores for each source across the samples. Resulting tibble contains the following columns:

  1. statistic: Indicates which method is associated with which score.

  2. source: Source nodes of network.

  3. condition: Condition representing each column of mat.

  4. score: Regulatory activity (enrichment score).

See Also

Other decoupleR statistics: decouple(), run_aucell(), run_gsva(), run_mdt(), run_mlm(), run_ora(), run_udt(), run_ulm(), run_viper(), run_wmean(), run_wsum()

Examples

inputs_dir <- system.file("testdata", "inputs", package = "decoupleR")

mat <- readRDS(file.path(inputs_dir, "input-expr_matrix.rds"))
network <- readRDS(file.path(inputs_dir, "input-dorothea_genesets.rds"))

run_fgsea(mat, network, .source='tf', nproc=1)

[Package decoupleR version 1.99.5 Index]