overrep_test: overrep_test

Description Usage Arguments Value Examples

View source: R/overrepresentation_test.r

Description

Overrepresentation test - Functional (usually gene ontology) analysis Performs a Fishers Exact test.

Usage

1
2
3
4
5
overrep_test(categories, query_genes, background_genes = NULL,
  min_query = 3, pval_threshold = 0.05, ease = TRUE,
  sig_digits = 4, mult_test = TRUE, super_strict = FALSE,
  return_genes = FALSE, min_genes_in_category = 5,
  max_genes_in_category = 500, unique_genes_in_categories = NULL)

Arguments

categories

list of named character vectors containing the functional groups. Each vector should contain gene names or IDs. The name of each vector should be the functional category.

query_genes

character vector of gene names

background_genes

character vector of gene names to use as the background set containing genes and associated information including location of genes

min_query

minimum number of query genes in the category for it be tested, no point having a category with one query gene in it

pval_threshold

p value threshold. Only results with p-value/corrected p-value less than this thrreshold will be returned.

mult_test

apply multiple testing correction (Benjamini-Hochberg FDR is used) and use the corrected value to filter for significant results. This should usually be set to TRUE (default). If set to false, the correction is still applied but the uncorrected pvalue is used to filter by.

super_strict

stricter pvalue correction where it takes the number of tests as being the total number of functional categories. By default the number of tests corrected for is only the number of functional categories that contain > min_query genes

min_genes_in_category

minimum number of genes in functional category for it to be tested

max_genes_in_category

maximum number of genes in functional category for it to be tested

unique_genes_in_categories

a vector of all the (deduplicated) genes in the functional categories. If the function is only being run once, this can be left as NULL (default). If the function will be run multiple times using the same set of functional categories it is more efficient to calculate this outside of the function and pass as a parameter. Calculated using: unique_genes_in_categories <- unique(as.vector(unlist(categories)))

Value

results of functional overrepresentation test. If no categories have a p-value <= pval_threshold a NULL object will be returned.

Examples

1
2
go_results <- overrep_test(all_go_categories, genes_1, background_genes)
head(go_results)

laurabiggins/runGOA documentation built on July 6, 2020, 12:51 p.m.