find_enriched_go_terms: Find enriched GO terms

Description Usage Arguments Details Value See Also Examples

View source: R/GO_terms_analysis.R

Description

Find enriched GO terms

Create the Gene to GO Term mapping

Usage

1
2
3
4
5
6
7
8
9
find_enriched_go_terms(
  assignments,
  gene_id_to_go,
  ontology = "BP",
  weighted = FALSE,
  node_size = 10
)

create_go_term_mapping(genes, gene_col = "refseq_mrna")

Arguments

assignments

boolean named vector determining the gene subset to be tested for enrichment of GO terms. The names of the vector should be the gene names. Elements with TRUE will consist of the gene cluster.

gene_id_to_go

List giving the Gene ID to GO object required for topGO (see topGOdata-class). create_go_term_mapping can construct such a list from a data-frame.

ontology

string, optional, default: BP. specficies which ontology to use (passed to ontology argument in creating a new topGOdata object). Can be 'BP', 'CC', or 'NF'. See topGOdata-class.

weighted

boolean, optional, default: FALSE. Whether to use the weighted algorithm or not in runTest.

node_size

integer, optional, default: 10. Consider only GO terms with node_size number of genes, passed to nodeSize argument of topGOdata-class

genes

dataframe, with two required columns. The first gives the gene names, with column name by the argument gene_col. The other column must be named "go_id" and give the genes GO id. Genes will have multiple GO id that they map to, and each go mapping of a gene is a separate row. Thus genes will be in multiple rows of the input.

gene_col

the name of the column of the genes data frame that contains the correct gene reference. By default, is "refseq_mrna".

Details

find_enriched_go_terms is a wrapper for running a GO enrichment analysis via the package topGO. This function creates a topGOdata-class object, runs the function runTest to test for enrichment using the statistic="fisher" option, and then runs GenTable. This function then does some post-processing of the results, returning only GO terms that satisfy:

  1. BH adjusted p-values less than 0.05 using p.adjust

  2. GO terms are enriched, i.e. the number of genes from the GO term found in the subset is greater than expected

Value

Returns results in the format of GenTable.

create_go_term_mapping returns a list giving the gene to GO id in the format required by topGOdata-class.

See Also

create_go_term_mapping, find_enriched_pathway, GenTable, runTest, topGOdata-class, p.adjust

Examples

1
2
3
4
5
6
7
8
data(exampleData)
head(testGenesGO) #gives the mapping of genes to GO
geneId2Go <- create_go_term_mapping(testGenesGO)
#create fake assignment of genes to group based on TRUE/FALSE values
inGroup=rep(FALSE,nrow(testData))
inGroup[1:10]=TRUE
names(inGroup) <- row.names(testData)
find_enriched_go_terms(inGroup, geneId2Go)

NelleV/moanin documentation built on July 28, 2021, 7:34 p.m.