calcGseaStat: Calculates GSEA statistics for a given query gene set

View source: R/fgsea.R

calcGseaStatR Documentation

Calculates GSEA statistics for a given query gene set

Description

Takes O(k log k) time, where k is a size of 'selectedSize'.

Usage

calcGseaStat(
  stats,
  selectedStats,
  gseaParam = 1,
  returnAllExtremes = FALSE,
  returnLeadingEdge = FALSE,
  scoreType = c("std", "pos", "neg")
)

Arguments

stats

Named numeric vector with gene-level statistics sorted in decreasing order (order is not checked).

selectedStats

Indexes of selected genes in the 'stats' array.

gseaParam

GSEA weight parameter (0 is unweighted, suggested value is 1).

returnAllExtremes

If TRUE return not only the most extreme point, but all of them. Can be used for enrichment plot

returnLeadingEdge

If TRUE return also leading edge genes.

scoreType

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

Value

Value of GSEA statistic if both returnAllExtremes and returnLeadingEdge are FALSE. Otherwise returns list with the folowing elements:

Examples

data(exampleRanks)
data(examplePathways)
ranks <- sort(exampleRanks, decreasing=TRUE)
es <- calcGseaStat(ranks, na.omit(match(examplePathways[[1]], names(ranks))))

ctlab/fgsea documentation built on Oct. 10, 2024, 10:31 a.m.