massiveORT: A wrapper to fisher.test to get over representation analysis...

View source: R/massiveORT.R

massiveORTR Documentation

A wrapper to fisher.test to get over representation analysis of gene sets.

Description

The function massiveORT essentially is a wrapper to the function fisher.test in charge to 1) arrange the input to feed fisher.test in sequence for each gene set, 2) arrange the output in a data frame compatible with the other function of the package, and 3) compute the universe of genes for the analysis.

Usage

massiveORT(gene_list, gene_sets, universe = NULL, 
          alternative = c("greater", "less", "two.sided"))

Arguments

gene_list

a list of gene names, or gene ids that have to match the corresponidng in the gene-set.

gene_sets

a character vector of gene-sets.

universe

a list of gene, or gene ids, that defines the universe for the analysis (see details); NULL by default.

alternative

a character string specifying the alternative hypothesis of the fisher.test; must be one of "two.sided", "greater" (default) or "less".

Details

This function allows to define externally or compute the universe of reference of the analysis. By default (universe = NULL), the universe is computed starting from the gene names contributing at least once in each gene set.

Value

A data frame with columns

universe_size

size of the universe of genes.

geneList_size

size of intersection between the gene list and the universe.

geneSet_size

size of intersection between the gene set and the universe.

geneList_in_GenesSet_size

size of the intersection between the geneList and the geneSet.

odds_ratio

odd ratio coming from the fisher.test

log2_odds_ratio

log2 transformation of odds_ratio.

p.value

p-values associated with the gene-set coming from the fisher.test

BH.value

Benijamini and Hockberg adjustment of the p.values

B.value

Bonferroni adjustment of the p.values

relevance

marginal ordering of the table.

Author(s)

Stefano M. Pagnotta

References

Cerulo, Pagnotta (2022) \Sexpr[results=rd]{tools:::Rd_expr_doi("10.3390/e24050739")}

See Also

fisher.test, cut_by_significance

Examples

library(massiveGST)

# get the gene profile
fname <- system.file("extdata", package="massiveGST")
fname <- file.path(fname, "pre_ranked_list.txt")
geneProfile <- get_geneProfile(fname)
geneList <- names(head(geneProfile, 1000))

# get the gene-sets
geneSets <- get_geneSets_from_msigdbr(category = "C5", subcategory = "CC", what = "gene_symbol")
geneSets <- geneSets[1:250]

# run the function
ans <- massiveORT(geneList, geneSets)
cut_by_significance(ans)

plot(cut_by_significance(ans), geneSets,as.network = TRUE)

massiveGST documentation built on March 31, 2023, 8:59 p.m.