gseaCurve: calculate coordinates for a GSEA plot

View source: R/gseaCurve.R

gseaCurveR Documentation

calculate coordinates for a GSEA plot

Description

Imports: grDevices dplyr

Usage

gseaCurve(rl, setlist, gsea = NULL, weight = 1)

Arguments

rl

named(!), sorted(!) vector. This ranked list's Values are the ranking metric (e.g. log2FC), names are the genes IDs. Gene IDs have to be of the same type as the ones in setList.

setlist

named(!) list of character vectors. Each vector is a gene signature, each item in that vector is a gene ID (same type as the ones in rl!)

gsea

data.frame with certain columns: pathway, pval, NES. The latter two will be printed on the GSEA plot.

weight

number, the higher the more important are the changes at the extremes. 0: no weight, i.e. each found gene counts the same. 1: each gene counts according to its metric. 2: genes counts according to their squared matric, etc.

Details

calculating the enrichment score at any given point follows standard rules. See for example https://www.pathwaycommons.org/guide/primers/data_analysis/gsea/

Value

a data.frame with coordinates for a GSEA plot. When given as an input, geom_gsea will automatically take care. Otherwise: x and y plot the regular curve (geom_path); x, y1ticks and y2ticks plot the ticks (use geom_segment); color, x, xGradientStart, y1gradient and y2gradient for color bar (use geom_rect)

Examples

library(gggsea)

curve <- gseaCurve(myRankedlist, mySetlist)


NicolasH2/gggsea documentation built on Jan. 28, 2024, 7:25 p.m.