gsea_by_group: Run a GSEA by group

Description Usage Arguments Value Methods (by generic) Examples

View source: R/gsea_methods.R

Description

Run a GSEA by group

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
gsea_by_group(
  formula,
  gene_identifier,
  data,
  set_list,
  nperm = 500,
  maxSize = 500,
  ...
)

## S3 method for class 'GroupedGSEA'
as.data.frame(
  x,
  row.names = NULL,
  optional = TRUE,
  ...,
  topn = Inf,
  wrap_len = 30,
  p.adjust_method = "BH"
)

## S3 method for class 'GroupedGSEA'
plot(x, ..., topn = 5, wrap_len = 30, p.adjust_method = "BH")

Arguments

formula

a formula of the kind numeric_score ~ group1 + group2 + ... identifying the column containing the score vs the grouping variables, which will be interacted with each other

gene_identifier

character

data

data.frame in which the formula and gene_identifer are interpreted

set_list

alternatively, a list of named and sorted input

nperm

Number of permutations to do. Minimial possible nominal p-value is about 1/nperm

maxSize

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

...

passed to fgsea::fgsea()

x

object of class GroupedGSEA

row.names

ignored

optional

ignored

topn

report at least this many pathways (by minimum p value across groups)

wrap_len

wrap pathway titles after this many characters

p.adjust_method

passed to stats::p.adjust()

Value

an object of class GroupedGSEA, which is internally just a list fgsea::fgsea() objects.

Methods (by generic)

Examples

1
2
3
4
5
6
data(exampleRanks, package = 'fgsea')
data(examplePathways, package = 'fgsea')
data = data.frame(score = exampleRanks, gene = names(exampleRanks), treatment = rep(c('A', 'B'), length.out = length(exampleRanks)))
gout = gsea_by_group(score ~ treatment, 'gene', data, pathways = examplePathways)
df = as.data.frame(gout)
plot(gout)

amcdavid/AMmisc documentation built on June 1, 2020, 11:04 a.m.