group_term_enrichment: Identify enriched terms in subgroup

View source: R/group-sim.R

group_term_enrichmentR Documentation

Identify enriched terms in subgroup

Description

Create a table of terms ranked by their significance of occurrence in a set of term sets amongst an enclosing set, with p-values computed by permutation. Terms are subselected so that only the minimal set of non-redundant terms at each level of frequency within the group are retained.

Usage

group_term_enrichment(
  ontology,
  term_sets,
  group,
  permutations = 1000L,
  min_terms = 2L,
  mc.cores = NULL
)

Arguments

ontology

ontology_index object.

term_sets

List of character vectors of ontological term IDs.

group

Integer/logical/character vector specifying indices/positions/names of subgroup for which to calculate a group similarity p-value.

permutations

Number of permutations to test against, or if NULL, perform no permutations and return the unadjusted p-values for the occurrence of each term.

min_terms

Minimum number of times a term should occur within the given group to be eligible for inclusion in the results.

mc.cores

If not null and greater than on, the number of cores use calculating permutations (passed to mclapply).

Value

data.frame containing columns: term (with the term ID); name (term readable name); in_term (number of sets in the given group of containing the term); in_no_term (number of sets in the given group not containing the term); out_term and out_no_term (equivalently for the sets not in the given group); p (the p-values calculated by permutation for seeing a term with such a strong association, measured using Fisher's exact test, in a group of term sets the size of the given group among term_sets). Rows ordered by significance (i.e. the p columns).

See Also

sample_group_sim create_sim_index


ontologySimilarity documentation built on May 29, 2024, 3:51 a.m.