term_2_gene_count: Function to Count the Number of Genes with an Annotation to...

View source: R/ontology_analysis.R

term_2_gene_countR Documentation

Function to Count the Number of Genes with an Annotation to an Ontology Term for each Term within an Ontology.

Description

This function counts the number of genes that are associated with each term of a specified ontology within a given geneset. Furthermore it counts the it counts the number of genes in the geneset that are characterized by the ontology, that is genes that have an annotation in the ontology.

Usage

term_2_gene_count(geneset, modus = "GO", category = "BP", GO_slim = FALSE)

Arguments

geneset

geneset of interest e.g. up-regulated genes. Must be supplied as character vector of FbgnIDs.

modus

"GO" or "PANTHER". Defaults to "GO".

GO_slim

logical. If TRUE, the function only uses PANTHER GO slim terms. Defaults to FALSE.

cagetory

GO category. Can be set to "BP", "MF", or "CC". Defaults to "BP".

Details

This function could potentially be extended to use other ontologies, if a mapping between genes and terms of the desired ontology is retrievable from some database. Please use up-to-date Fbgn IDs when using this function. map ezids to goids; no NAs in input allowed; output is list of lists with evidence source information and other information make list of GO_IDs for every Entrez_ids -> list of lists unique to remove replicates from different evidence sources

Value

term_2_gene_count returns a list of four elements.
The first element identified by "countTable" is a dataframe containing a column with the ontology identifers and the number of genes in the geneset that are annotated to it.
The second element identified by "num_char" is an integer giving the number of characterized genes in the geneset.
The third element identified by "num_all" is an integer giving the number of all genes that are present in the geneset.
The fourth element identified by "gen_annot_2_ID" is a dataframe with the Entrez IDs that are annotated to each Ontology ID.


zellerino/BOAT---biological-ontology-analysis-tool documentation built on Jan. 27, 2023, 3:38 p.m.